ffdec: Do not use invalid input timestamp as next timestamp.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Mon, 28 Feb 2011 21:16:24 +0000 (21:16 +0000)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 9 May 2011 09:02:50 +0000 (11:02 +0200)
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

index 1318601..305178c 100644 (file)
@@ -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,