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
* 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;