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.
Unified · Split
| @@ -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); |