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

Clément Bœsch ubitux at gmail.com
Fri Nov 23 21:13:05 CET 2012


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);
         if (ret < 0) {
             av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n",
                    filename, (double)timestamp / AV_TIME_BASE);
-- 
1.8.0



More information about the ffmpeg-devel mailing list