[FFmpeg-devel] [PATCH] libavformat/mov.c: use calculated dts offset when seeking in streams

Michael Niedermayer michael at niedermayer.cc
Fri Oct 27 04:38:20 EEST 2017


On Mon, Jun 19, 2017 at 11:08:45PM +0200, Jonas Licht wrote:
> 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 at fem.tu-ilmenau.de>
> ---
>  libavformat/mov.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

breaks make fate:
either therers something wrong in the chnage or fate needs to be updated

--- ./tests/ref/seek/extra-mp4  2017-10-27 03:04:37.457820255 +0200
+++ tests/data/fate/seek-extra-mp4      2017-10-27 03:32:10.625855082 +0200
@@ -28,10 +28,10 @@
 ret: 0         st: 0 flags:0 dts: 50.666667 pts: 50.666667 pos:5927464 size:   150
 ret: 0         st: 0 flags:0 dts: 50.700000 pts: 50.700000 pos:5927614 size:   176
 ret: 0         st:-1 flags:1  ts: 153.470835
-ret: 0         st: 0 flags:1 dts: 153.466667 pts: 153.500000 pos:15867700 size: 96169
-ret: 0         st: 0 flags:0 dts: 153.500000 pts: 153.533333 pos:15963869 size:   785
-ret: 0         st: 0 flags:0 dts: 153.533333 pts: 153.633333 pos:15964654 size:  3135
-ret: 0         st: 0 flags:0 dts: 153.566667 pts: 153.566667 pos:15967789 size:   859
+ret: 0         st: 0 flags:1 dts: 151.966667 pts: 152.000000 pos:15705355 size:146924
+ret: 0         st: 0 flags:0 dts: 152.000000 pts: 152.100000 pos:15852279 size:  1355
+ret: 0         st: 0 flags:0 dts: 152.033333 pts: 152.033333 pos:15853634 size:   211
+ret: 0         st: 0 flags:0 dts: 152.066667 pts: 152.066667 pos:15853845 size:   217
 ret: 0         st: 0 flags:0  ts: 76.365000
 ret: 0         st: 0 flags:1 dts: 77.833333 pts: 77.866667 pos:8659657 size: 41182
 ret: 0         st: 0 flags:0 dts: 77.866667 pts: 77.966667 pos:8700839 size:  4197
@@ -83,10 +83,10 @@
 ret: 0         st: 0 flags:0 dts: 101.366667 pts: 101.366667 pos:11053072 size:   562
 ret: 0         st: 0 flags:0 dts: 101.400000 pts: 101.400000 pos:11053634 size:   599
 ret: 0         st:-1 flags:0  ts: 25.306672
-ret: 0         st: 0 flags:1 dts: 27.400000 pts: 27.433333 pos:2674605 size:127383
-ret: 0         st: 0 flags:0 dts: 27.433333 pts: 27.466667 pos:2801988 size:    68
-ret: 0         st: 0 flags:0 dts: 27.466667 pts: 27.500000 pos:2802268 size:  1754
-ret: 0         st: 0 flags:0 dts: 27.500000 pts: 27.533333 pos:2804022 size:  4071
+ret: 0         st: 0 flags:1 dts: 25.300000 pts: 25.333333 pos:2607246 size: 40273
+ret: 0         st: 0 flags:0 dts: 25.333333 pts: 25.433333 pos:2647519 size:  2959
+ret: 0         st: 0 flags:0 dts: 25.366667 pts: 25.366667 pos:2650478 size:   197
+ret: 0         st: 0 flags:0 dts: 25.400000 pts: 25.400000 pos:2650675 size:   230
 ret: 0         st:-1 flags:1  ts: 128.200839
 ret: 0         st: 0 flags:1 dts: 127.833333 pts: 127.866667 pos:13514072 size: 67382
 ret: 0         st: 0 flags:0 dts: 127.866667 pts: 127.966667 pos:13581454 size:  2936
Test seek-extra-mp4 failed. Look at tests/data/fate/seek-extra-mp4.err for details.
make: *** [fate-seek-extra-mp4] Error 1

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Never trust a computer, one day, it may think you are the virus. -- Compn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171027/3ab5dc57/attachment.sig>


More information about the ffmpeg-devel mailing list