mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
videorate: clear discont on duplicated buffers
When videorate duplicates a buffer with a DISCONT flag, it copies the discont on the first pushed buffer but fails to clear it for subsequent buffers. This causes theoraenc!oggmux and possibly other elements to consider this a discont stream. Fix videorate to produce discont as the first buffer and after a flushing seek. Fixes #580271.
This commit is contained in:
parent
e25f281de8
commit
915b3d139d
2 changed files with 12 additions and 0 deletions
|
@ -149,6 +149,7 @@ gst_video_rate_base_init (gpointer g_class)
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_video_rate_src_template));
|
gst_static_pad_template_get (&gst_video_rate_src_template));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_video_rate_class_init (GstVideoRateClass * klass)
|
gst_video_rate_class_init (GstVideoRateClass * klass)
|
||||||
{
|
{
|
||||||
|
@ -357,6 +358,7 @@ gst_video_rate_reset (GstVideoRate * videorate)
|
||||||
videorate->drop = 0;
|
videorate->drop = 0;
|
||||||
videorate->dup = 0;
|
videorate->dup = 0;
|
||||||
videorate->next_ts = GST_CLOCK_TIME_NONE;
|
videorate->next_ts = GST_CLOCK_TIME_NONE;
|
||||||
|
videorate->discont = TRUE;
|
||||||
gst_video_rate_swap_prev (videorate, NULL, 0);
|
gst_video_rate_swap_prev (videorate, NULL, 0);
|
||||||
|
|
||||||
gst_segment_init (&videorate->segment, GST_FORMAT_TIME);
|
gst_segment_init (&videorate->segment, GST_FORMAT_TIME);
|
||||||
|
@ -409,6 +411,12 @@ gst_video_rate_flush_prev (GstVideoRate * videorate)
|
||||||
GST_BUFFER_OFFSET (outbuf) = videorate->out;
|
GST_BUFFER_OFFSET (outbuf) = videorate->out;
|
||||||
GST_BUFFER_OFFSET_END (outbuf) = videorate->out + 1;
|
GST_BUFFER_OFFSET_END (outbuf) = videorate->out + 1;
|
||||||
|
|
||||||
|
if (videorate->discont) {
|
||||||
|
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
|
||||||
|
videorate->discont = FALSE;
|
||||||
|
} else
|
||||||
|
GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DISCONT);
|
||||||
|
|
||||||
/* this is the timestamp we put on the buffer */
|
/* this is the timestamp we put on the buffer */
|
||||||
push_ts = videorate->next_ts;
|
push_ts = videorate->next_ts;
|
||||||
|
|
||||||
|
@ -810,6 +818,9 @@ gst_video_rate_change_state (GstElement * element, GstStateChange transition)
|
||||||
videorate = GST_VIDEO_RATE (element);
|
videorate = GST_VIDEO_RATE (element);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
|
videorate->discont = TRUE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ struct _GstVideoRate
|
||||||
GstBuffer *prevbuf;
|
GstBuffer *prevbuf;
|
||||||
guint64 prev_ts; /* Previous buffer timestamp */
|
guint64 prev_ts; /* Previous buffer timestamp */
|
||||||
guint64 segment_out; /* in-segment counting */
|
guint64 segment_out; /* in-segment counting */
|
||||||
|
gboolean discont;
|
||||||
|
|
||||||
/* segment handling */
|
/* segment handling */
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
|
|
Loading…
Reference in a new issue