From a3c56f60cdb81a7100352821e2972b3014286ee9 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Mon, 28 Feb 2011 21:16:24 +0000 Subject: [PATCH] ffdec: Do not use invalid input timestamp as next timestamp. When input buffer timestamps are invalid, next timestamp are used for audio. Then, the next out timestamp is updated with the used timestamp and the calculated duration. However, if the used timestamp is invalid, it should not be used. Otherwise, the next buffer will use a wrong timestamp that is not in the clipped segment, making the buffer to be dropped. This fixes playback with SBTVD MPEG TS streams, using AAC LATM. --- ext/ffmpeg/gstffmpegdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 13186019bf..305178c2f0 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -2119,7 +2119,8 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec, gst_buffer_set_caps (*outbuf, GST_PAD_CAPS (ffmpegdec->srcpad)); /* the next timestamp we'll use when interpolating */ - ffmpegdec->next_out = out_timestamp + out_duration; + if (GST_CLOCK_TIME_IS_VALID (out_timestamp)) + ffmpegdec->next_out = out_timestamp + out_duration; /* now see if we need to clip the buffer against the segment boundaries. */ if (G_UNLIKELY (!clip_audio_buffer (ffmpegdec, *outbuf, out_timestamp,