libavformat/mov.c: use calculated dts offset when seeking in streams
authorJonas Licht <jonas.licht@fem.tu-ilmenau.de>
Sun, 29 Oct 2017 11:11:39 +0000 (12:11 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 30 Oct 2017 00:09:40 +0000 (01:09 +0100)
commit59ad504696958fbd9db7b478b4b7e0a2b436b7f2
treef3ded368911b57a1f20479151bbf0f06c8df12ae
parentd3f1b0d3d87f782d6a89a73c57e8be992d4785da
libavformat/mov.c: use calculated dts offset when seeking in streams

Subtract the calculated dts offset from the requested timestamp before
seeking. This fixes an error "Error while filtering: Operation not
permitted" observed with a short file which contains only one key frame
and starts with negative timestamps.

Then, av_index_search_timestamp() returns a valid negative timestamp,
but mov_seek_stream bails out with AVERROR_INVALIDDATA.

Fixes ticket #6139.

Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
Signed-off-by: Peter Gro├če <pegro@friiks.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c
tests/ref/seek/extra-mp4