mpegvideoparse: Apply previous timestamp when there isn't any newer.

If the current incoming packet didn't carry a timestamp, but a
previous packet had one we didn't yet use, then apply that timestamp
to the next picture.
Fixes: #618336
This commit is contained in:
Jan Schmidt 2010-06-15 17:16:12 +10:00
parent 85d3c03d26
commit 2f9b765326

View file

@ -319,7 +319,8 @@ handle_packet (MPEGPacketiser * p, guint64 offset, guint8 pack_type)
* previous buffer in order to handle this correctly. It would still be
* possible to get it wrong if there was a PES packet smaller than 3 bytes
* but anyone that does that can suck it. */
if (offset >= p->tracked_offset) {
if ((offset >= p->tracked_offset)
&& (p->cur_buf_ts != GST_CLOCK_TIME_NONE)) {
/* sync word started within this buffer - take the cur ts */
ts = p->cur_buf_ts;
p->cur_buf_ts = GST_CLOCK_TIME_NONE;