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.
This commit is contained in:
Thadeu Lima de Souza Cascardo 2011-02-28 21:16:24 +00:00 committed by Sebastian Dröge
parent 920bfb0da2
commit a3c56f60cd

View 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,