From 65624afd8f454986d90fe56337589a24cdddd9ca Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 17 Jun 2013 08:58:13 +0200 Subject: [PATCH] videodecoder: Fix drop frame handling at startup In the unlikely case that the decoder drops a frame before the first input frame is outputted, use the input segment (since it wasn't carried over to the output segment yet) https://bugzilla.gnome.org/show_bug.cgi?id=702502 --- gst-libs/gst/video/gstvideodecoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index cfd8dce852..1f392e3650 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -2378,6 +2378,8 @@ gst_video_decoder_drop_frame (GstVideoDecoder * dec, GstVideoCodecFrame * frame) timestamp = frame->pts; segment = &dec->output_segment; + if (G_UNLIKELY (segment->format == GST_FORMAT_UNDEFINED)) + segment = &dec->input_segment; stream_time = gst_segment_to_stream_time (segment, GST_FORMAT_TIME, timestamp); qostime = gst_segment_to_running_time (segment, GST_FORMAT_TIME, timestamp);