[FFmpeg-devel] [PATCH] ffmpeg: switch to avformat_seek_file for stream_loop

Michael Niedermayer michael at niedermayer.cc
Mon Sep 2 18:54:03 EEST 2019


On Sat, Aug 31, 2019 at 08:28:51PM +0530, Gyan wrote:
> A user observed that stream_loop didn't work with very short FLV files.
> seek_to_start in ffmpeg.c calls av_seek_frame with no flags; FLV seek only
> works with RTMP protocol so lavf falls back on seek_frame_generic which
> searches forward, skipping a GOP. With files with two index entries in
> stream, the file doesn't loop at all.
> 
> I switched to avformat_seek_file which will set the BACKWARDS flag when
> seeking to start of file. stream_loop works and no frames are dropped.
> 
> FATE passes.
> 
> Gyan

>  ffmpeg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> c79dc6d27a9c8c1bd0cffa2d251b2aa7caf23bf3  0001-ffmpeg-switch-to-avformat_seek_file-for-stream_loop.patch
> From 4af64f612c65378f0a220284ca99ad033ece8cd3 Mon Sep 17 00:00:00 2001
> From: Gyan Doshi <ffmpeg at gyani.pro>
> Date: Sat, 31 Aug 2019 19:45:58 +0530
> Subject: [PATCH] ffmpeg: switch to avformat_seek_file for stream_loop
> 
> Fixes stream_loop with very short files where seeking is generic index
> search
> ---
>  fftools/ffmpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

probably ok

it also might make sense to add the testcase to fate as you mentioned "short"

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190902/ad5174ed/attachment.sig>


More information about the ffmpeg-devel mailing list