summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-05-20 20:39:01 +0200
committerKacper Michajłow <kasper93@gmail.com>2024-05-22 22:13:54 +0200
commit82ce07d64052afeaf8a16abae5e9e1319509bb4f (patch)
tree65074dc67844510a7c5f197e3b04ff677eadf71a
parent6eb0f4b27fc0ea7f9299f637a846e950854fe961 (diff)
downloadmpv-82ce07d64052afeaf8a16abae5e9e1319509bb4f.tar.bz2
mpv-82ce07d64052afeaf8a16abae5e9e1319509bb4f.tar.xz
ad_spdif: check for AC3 if parser fails to detect profile
c522d0dfbd9b9663c4e084261a353ee45991fd86 added parser to avoid opening decoder and left decoder only for DTS. Since then more audio codec needs decoder, so open decoder always when it might be needed. Exclude only AC3, other codec have profile to be extracted. Fixes: c522d0dfbd9b9663c4e084261a353ee45991fd86
-rw-r--r--audio/decode/ad_spdif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
index 65e1bf8654..81f021b8eb 100644
--- a/audio/decode/ad_spdif.c
+++ b/audio/decode/ad_spdif.c
@@ -121,12 +121,13 @@ static void determine_codec_params(struct mp_filter *da, AVPacket *pkt,
av_parser_parse2(parser, ctx, &d, &s, pkt->data, pkt->size, 0, 0, 0);
*out_profile = profile = ctx->profile;
*out_rate = ctx->sample_rate;
+ spdif_ctx->codec->codec_profile = avcodec_profile_name(spdif_ctx->codec_id, profile);
avcodec_free_context(&ctx);
av_parser_close(parser);
}
- if (profile != AV_PROFILE_UNKNOWN || spdif_ctx->codec_id != AV_CODEC_ID_DTS)
+ if (profile != AV_PROFILE_UNKNOWN || spdif_ctx->codec_id == AV_CODEC_ID_AC3)
return;
const AVCodec *codec = avcodec_find_decoder(spdif_ctx->codec_id);