Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 7/7] ffmpeg: make the ac option set the demuxer's ch_layout AVOption
Date: Sun, 20 Mar 2022 17:06:34 -0300
Message-ID: <20220320200634.51420-1-jamrial@gmail.com> (raw)
In-Reply-To: <YjeEOmFwEpe+MSG4@phare.normalesup.org>

channels is deprecated on all supported raw demuxers.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffmpeg_opt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 720a3cc46a..b3edbf9885 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1122,7 +1122,11 @@ static int open_input_file(OptionsContext *o, const char *filename)
         if (file_iformat && (priv_class = file_iformat->priv_class) &&
             av_opt_find(&priv_class, "channels", NULL, 0,
                         AV_OPT_SEARCH_FAKE_OBJ)) {
-            av_dict_set_int(&o->g->format_opts, "channels", o->audio_channels[o->nb_audio_channels - 1].u.i, 0);
+            AVBPrint bp;
+            av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
+            av_bprintf(&bp, "%dC", o->audio_channels[o->nb_audio_channels - 1].u.i);
+            av_dict_set(&o->g->format_opts, "ch_layout", bp.str, 0);
+            av_bprint_finalize(&bp, NULL);
         }
     }
     if (o->nb_audio_ch_layouts) {
-- 
2.35.1

_______________________________________________
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".

  parent reply	other threads:[~2022-03-20 20:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 19:36 [FFmpeg-devel] [PATCH 1/7] avformat/pcmdec: deprecate channels option James Almer
2022-03-20 19:36 ` [FFmpeg-devel] [PATCH 2/7 v2] avformat/pcmdec: add support to set channel layout in sln demuxer James Almer
2022-03-20 19:36 ` [FFmpeg-devel] [PATCH 3/7 v2] avformat/dfpwmdec: add support to set channel layout James Almer
2022-03-20 19:36 ` [FFmpeg-devel] [PATCH 4/7 v2] avformat/test/seek: set ch_layout instead of channels James Almer
2022-03-20 19:36 ` [FFmpeg-devel] [PATCH 5/7 v2] ffmpeg: replace custom channel_layout code with an SpecifierOpt based one James Almer
2022-03-20 19:36 ` [FFmpeg-devel] [PATCH 6/7] ffmpeg: add a ch_layout option as an alias to channel_layout James Almer
2022-03-20 19:36 ` [FFmpeg-devel] [PATCH 7/7] ffmpeg: deprecate the ac option James Almer
2022-03-20 19:44   ` Nicolas George
2022-03-20 20:05     ` James Almer
2022-03-20 20:06     ` James Almer [this message]
2022-03-20 20:09       ` [FFmpeg-devel] [PATCH 7/7] ffmpeg: make the ac option set the demuxer's ch_layout AVOption Nicolas George
2022-03-20 20:15         ` James Almer
2022-03-21 21:12           ` Andreas Rheinhardt
2022-03-21 21:27             ` James Almer

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=20220320200634.51420-1-jamrial@gmail.com \
    --to=jamrial@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