History

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.

Kacper Michajłow committed 2 years ago

Commit 82ce07d1 parent 6eb0f4b1 file · +2 −1Browse files

Unified · Split

audio/decode/ad_spdif.c+2−1
@@ -121,12 +121,13 @@ static void determine_codec_params(struct mp_filter *da, AVPacket *pkt, · 120 unmodified lines
121 av_parser_parse2(parser, ctx, &d, &s, pkt->data, pkt->size, 0, 0, 0);121 av_parser_parse2(parser, ctx, &d, &s, pkt->data, pkt->size, 0, 0, 0);
122 *out_profile = profile = ctx->profile;122 *out_profile = profile = ctx->profile;
123 *out_rate = ctx->sample_rate;123 *out_rate = ctx->sample_rate;
124 spdif_ctx->codec->codec_profile = avcodec_profile_name(spdif_ctx->codec_id, profile);
124 125
125 avcodec_free_context(&ctx);126 avcodec_free_context(&ctx);
126 av_parser_close(parser);127 av_parser_close(parser);
127 }128 }
128 129
129 if (profile != AV_PROFILE_UNKNOWN || spdif_ctx->codec_id != AV_CODEC_ID_DTS)130 if (profile != AV_PROFILE_UNKNOWN || spdif_ctx->codec_id == AV_CODEC_ID_AC3)
130 return;131 return;
131 132
132 const AVCodec *codec = avcodec_find_decoder(spdif_ctx->codec_id);133 const AVCodec *codec = avcodec_find_decoder(spdif_ctx->codec_id);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t