[FFmpeg-devel] [PATCH] ffmpeg: use avformat_seek_file() instead of av_seek_frame().

Michael Niedermayer michaelni at gmx.at
Fri Nov 23 22:13:13 CET 2012


On Fri, Nov 23, 2012 at 09:13:05PM +0100, Clément Bœsch wrote:
> avformat_seek_file() is the new API. It will make sure the read_seek2()
> callback is called when the demuxer has it.
> ---
>  ffmpeg_opt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index 09b4aaf..ad808ff 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -807,7 +807,7 @@ static int opt_input_file(void *optctx, const char *opt, const char *filename)
>  
>      /* if seeking requested, we execute it */
>      if (o->start_time != 0) {
> -        ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);
> +        ret = avformat_seek_file(ic, -1, INT64_MIN, timestamp, INT64_MAX, 0);

these are not equivalent.

Also currently if one seeks to X the seek favor backward seeking and
can together with skiping everything before X give exact seeking.
so the backward favoring should be kept in this case i think

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121123/247c1dca/attachment.asc>


More information about the ffmpeg-devel mailing list