Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Marvin Scholz <epirat07@gmail.com>
Subject: Re: [FFmpeg-devel] [PATCH] ffmpeg: Make find_stream_info behave like a normal per-file option
Date: Wed, 12 Oct 2022 19:39:43 +0200
Message-ID: <166559638370.12287.16758170459214904063@lain.khirnov.net> (raw)
In-Reply-To: <20220928102101.37967-1-epirat07@gmail.com>

Quoting Marvin Scholz (2022-09-28 12:21:00)
> 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.

Well, it's not documented at all.

> ---
>  fftools/ffmpeg.h     | 1 +
>  fftools/ffmpeg_opt.c | 7 ++++---
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
> index ede0b2bd96..3389ce5edc 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 5febe319e4..df1c8df454 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -190,7 +190,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)
>  {
> @@ -240,6 +239,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;
>  }
>  
> @@ -1307,7 +1307,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;
>  
> @@ -4000,7 +4000,8 @@ 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_PERFILE | OPT_INPUT | OPT_EXPERT | OPT_OFFSET, 
> +                                                                     { .off = OFFSET(find_stream_info) },

You can drop OPT_PERFILE, since it's implied by OPT_OFFSET.

Otherwise patch LGTM, I'll do the change myself and push if you don't
object.

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-10-12 17:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 10:21 Marvin Scholz
2022-10-12 17:39 ` Anton Khirnov [this message]
2022-10-12 22:08   ` Marvin Scholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=166559638370.12287.16758170459214904063@lain.khirnov.net \
    --to=anton@khirnov.net \
    --cc=epirat07@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git