From 811bd0784679dfcb4ed02043a37c92f9df10500e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 15 Jun 2013 09:59:40 +0200 Subject: avconv: make input -ss accurate when transcoding Insert (a)trim filters on the corresponding inputs, so the extra frames are decoded and discarded. --- avconv_opt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'avconv_opt.c') diff --git a/avconv_opt.c b/avconv_opt.c index c8d917638b..f14d7f1c62 100644 --- a/avconv_opt.c +++ b/avconv_opt.c @@ -117,6 +117,7 @@ static void init_options(OptionsContext *o) o->recording_time = INT64_MAX; o->limit_filesize = UINT64_MAX; o->chapters_input_file = INT_MAX; + o->accurate_seek = 1; } /* return a copy of the input with the stream specifiers removed from the keys */ @@ -687,9 +688,11 @@ static int open_input_file(OptionsContext *o, const char *filename) f->ctx = ic; f->ist_index = nb_input_streams - ic->nb_streams; + f->start_time = o->start_time; f->ts_offset = o->input_ts_offset - (copy_ts ? 0 : timestamp); f->nb_streams = ic->nb_streams; f->rate_emu = o->rate_emu; + f->accurate_seek = o->accurate_seek; /* check if all codec options have been used */ unused_opts = strip_specifiers(o->g->codec_opts); @@ -2151,6 +2154,9 @@ const OptionDef options[] = { { "ss", HAS_ARG | OPT_TIME | OPT_OFFSET | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(start_time) }, "set the start time offset", "time_off" }, + { "accurate_seek", OPT_BOOL | OPT_OFFSET | OPT_EXPERT | + OPT_INPUT, { .off = OFFSET(accurate_seek) }, + "enable/disable accurate seeking with -ss" }, { "itsoffset", HAS_ARG | OPT_TIME | OPT_OFFSET | OPT_EXPERT | OPT_INPUT, { .off = OFFSET(input_ts_offset) }, "set the input ts offset", "time_off" }, -- cgit v1.2.3