From 13799148575f228b518ff8967bd7d363fa86355a Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 22 Oct 2022 17:14:26 +0200 Subject: [PATCH] [xcode] See if we can do without asking decoder for specific sample rate/channels We use filters now, so shouldn't be necessary. request_sample_fmt and request_channel_layout was added with commit 73b2d08. --- src/transcode.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/transcode.c b/src/transcode.c index 82738941..dc7d2d0b 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -945,10 +945,6 @@ open_decoder(AVCodecContext **dec_ctx, unsigned int *stream_index, struct decode #else // Not const before ffmpeg 5.0 AVCodec *decoder; -#endif - AVDictionary *options = NULL; -#if USE_CH_LAYOUT - char downmix_layout[64]; #endif int ret; @@ -975,19 +971,7 @@ open_decoder(AVCodecContext **dec_ctx, unsigned int *stream_index, struct decode return ret; } - if (type == AVMEDIA_TYPE_AUDIO) - { - (*dec_ctx)->request_sample_fmt = ctx->settings.sample_format; -#if USE_CH_LAYOUT - // option types is a string - see AV_OPT_TYPE_CHLAYOUT handling in ffmpeg:libavutil/opt.c - av_channel_layout_describe(&ctx->settings.channel_layout, downmix_layout, sizeof(downmix_layout)); - av_dict_set(&options, "downmix", downmix_layout, 0); -#else - (*dec_ctx)->request_channel_layout = ctx->settings.channel_layout; -#endif - } - - ret = avcodec_open2(*dec_ctx, NULL, options == NULL ? NULL : &options); + ret = avcodec_open2(*dec_ctx, NULL, NULL); if (ret < 0) { DPRINTF(E_LOG, L_XCODE, "Failed to open decoder for stream #%d: %s\n", *stream_index, err2str(ret));