mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
textoverlay: keep untimestamped textbuffer until next one
Instead of discarding untimestamped text-buffers immeditely after rendering, keep them until we receive the next text buffer. Fixes #654959
This commit is contained in:
parent
69dcacf148
commit
0667b1adf5
1 changed files with 16 additions and 11 deletions
|
@ -2390,16 +2390,22 @@ gst_text_overlay_text_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
else if (GST_BUFFER_DURATION_IS_VALID (buffer))
|
else if (GST_BUFFER_DURATION_IS_VALID (buffer))
|
||||||
GST_BUFFER_DURATION (buffer) = clip_stop - clip_start;
|
GST_BUFFER_DURATION (buffer) = clip_stop - clip_start;
|
||||||
|
|
||||||
/* Wait for the previous buffer to go away */
|
if (overlay->text_buffer
|
||||||
while (overlay->text_buffer != NULL) {
|
&& (!GST_BUFFER_TIMESTAMP_IS_VALID (overlay->text_buffer)
|
||||||
GST_DEBUG ("Pad %s:%s has a buffer queued, waiting",
|
|| !GST_BUFFER_DURATION_IS_VALID (overlay->text_buffer))) {
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
gst_text_overlay_pop_text (overlay);
|
||||||
GST_TEXT_OVERLAY_WAIT (overlay);
|
} else {
|
||||||
GST_DEBUG ("Pad %s:%s resuming", GST_DEBUG_PAD_NAME (pad));
|
/* Wait for the previous buffer to go away */
|
||||||
if (overlay->text_flushing) {
|
while (overlay->text_buffer != NULL) {
|
||||||
GST_OBJECT_UNLOCK (overlay);
|
GST_DEBUG ("Pad %s:%s has a buffer queued, waiting",
|
||||||
ret = GST_FLOW_WRONG_STATE;
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
goto beach;
|
GST_TEXT_OVERLAY_WAIT (overlay);
|
||||||
|
GST_DEBUG ("Pad %s:%s resuming", GST_DEBUG_PAD_NAME (pad));
|
||||||
|
if (overlay->text_flushing) {
|
||||||
|
GST_OBJECT_UNLOCK (overlay);
|
||||||
|
ret = GST_FLOW_WRONG_STATE;
|
||||||
|
goto beach;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2548,7 +2554,6 @@ wait_for_text_buf:
|
||||||
!GST_BUFFER_DURATION_IS_VALID (overlay->text_buffer)) {
|
!GST_BUFFER_DURATION_IS_VALID (overlay->text_buffer)) {
|
||||||
GST_WARNING_OBJECT (overlay,
|
GST_WARNING_OBJECT (overlay,
|
||||||
"Got text buffer with invalid timestamp or duration");
|
"Got text buffer with invalid timestamp or duration");
|
||||||
pop_text = TRUE;
|
|
||||||
valid_text_time = FALSE;
|
valid_text_time = FALSE;
|
||||||
} else {
|
} else {
|
||||||
text_start = GST_BUFFER_TIMESTAMP (overlay->text_buffer);
|
text_start = GST_BUFFER_TIMESTAMP (overlay->text_buffer);
|
||||||
|
|
Loading…
Reference in a new issue