qtdemux: fix key unit seek corner case
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 22 Jul 2019 23:42:02 +0000 (01:42 +0200)
committerMathieu Duponchelle <mduponchelle1@gmail.com>
Fri, 26 Jul 2019 01:50:47 +0000 (01:50 +0000)
commit104f459258cbede84f1571671642873eaab91456
treede19b9f6391c90bf1196756bf400463826937962
parent4911ac38acfbaf4c8424891c8738447f75ef0c7e
qtdemux: fix key unit seek corner case

If a key unit seek is performed with a time position that matches
the offset of a keyframe, but not its actual PTS, we need to
adjust the segment nevertheless.

For example consider the following case:

* stream starts with a keyframe at 0 nanosecond, lasting 40 milliseconds
* user does a key unit seek at 20 milliseconds
* we don't adjust the segment as the time position is "over" a keyframe
* we push a segment that starts at 20 milliseconds
* we push a buffer with PTS == 0
* an element downstream (eg rtponviftimestamp) tries to calculate the
  stream time of the buffer, fails to do so and drops it
gst/isomp4/qtdemux.c