From 951153e733755efabc9f654a8052784349da389f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Tue, 2 Apr 2024 18:58:48 +0300 Subject: audio/ad_spdif: specify media type and sample rate in output codecpar No idea how things previously worked without having these set, but apparently they did... If this was a normal encoder to muxer case, we would utilize `avcodec_parameters_to_context`, but alas this is not. Fixes: #13794 --- audio/decode/ad_spdif.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'audio/decode/ad_spdif.c') diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c index a8e77b4e99..fd11691326 100644 --- a/audio/decode/ad_spdif.c +++ b/audio/decode/ad_spdif.c @@ -196,7 +196,8 @@ static int init_filter(struct mp_filter *da) if (!stream) goto fail; - stream->codecpar->codec_id = spdif_ctx->codec_id; + stream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + stream->codecpar->codec_id = spdif_ctx->codec_id; AVDictionary *format_opts = NULL; @@ -260,6 +261,8 @@ static int init_filter(struct mp_filter *da) abort(); } + stream->codecpar->sample_rate = samplerate; + struct mp_chmap chmap; mp_chmap_from_channels(&chmap, num_channels); mp_aframe_set_chmap(spdif_ctx->fmt, &chmap); -- cgit v1.2.3