[FFmpeg-cvslog] ffmpeg: Make find_stream_info behave like a normal per-file option
Marvin Scholz
git at videolan.org
Thu Oct 13 11:21:15 EEST 2022
ffmpeg | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Sep 28 12:21:00 2022 +0200| [3ce161610647e034e7d42caeb192ae0653bdffe6] | committer: Anton Khirnov
ffmpeg: Make find_stream_info behave like a normal per-file option
Currently it would essentially change the find_stream_info setting for
the file it was specified for and all following files, which is unusual
and somewhat unexpected behaviour for a per-file option and not even
documented to behave like this.
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ce161610647e034e7d42caeb192ae0653bdffe6
---
fftools/ffmpeg.h | 1 +
fftools/ffmpeg_opt.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 8460391afa..9c908e7465 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -126,6 +126,7 @@ typedef struct OptionsContext {
int accurate_seek;
int thread_queue_size;
int input_sync_ref;
+ int find_stream_info;
SpecifierOpt *ts_scale;
int nb_ts_scale;
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 8f57b699f1..c1de4e5041 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -189,7 +189,6 @@ static int input_stream_potentially_available = 0;
static int ignore_unknown_streams = 0;
static int copy_unknown_streams = 0;
static int recast_media = 0;
-static int find_stream_info = 1;
static void uninit_options(OptionsContext *o)
{
@@ -239,6 +238,7 @@ static void init_options(OptionsContext *o)
o->accurate_seek = 1;
o->thread_queue_size = -1;
o->input_sync_ref = -1;
+ o->find_stream_info = 1;
o->shortest_buf_duration = 10.f;
}
@@ -1306,7 +1306,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
for (i = 0; i < ic->nb_streams; i++)
choose_decoder(o, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE);
- if (find_stream_info) {
+ if (o->find_stream_info) {
AVDictionary **opts = setup_find_stream_info_opts(ic, o->g->codec_opts);
int orig_nb_streams = ic->nb_streams;
@@ -3997,7 +3997,7 @@ const OptionDef options[] = {
{ "thread_queue_size", HAS_ARG | OPT_INT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT | OPT_OUTPUT,
{ .off = OFFSET(thread_queue_size) },
"set the maximum number of queued packets from the demuxer" },
- { "find_stream_info", OPT_BOOL | OPT_PERFILE | OPT_INPUT | OPT_EXPERT, { &find_stream_info },
+ { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT | OPT_OFFSET, { .off = OFFSET(find_stream_info) },
"read and decode the streams to fill missing information with heuristics" },
{ "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT,
{ .off = OFFSET(bits_per_raw_sample) },
More information about the ffmpeg-cvslog
mailing list