diff options
author | Jan Ekström <jeebjp@gmail.com> | 2024-04-02 18:58:48 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2024-04-04 17:03:48 +0300 |
commit | 951153e733755efabc9f654a8052784349da389f (patch) | |
tree | 7529496051aab74f43fa1c8226a376e78bed83c8 /audio/decode/ad_spdif.c | |
parent | e8fb38645639595fc1faef45e3704907321ba2cc (diff) | |
download | mpv-951153e733755efabc9f654a8052784349da389f.tar.bz2 mpv-951153e733755efabc9f654a8052784349da389f.tar.xz |
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
Diffstat (limited to 'audio/decode/ad_spdif.c')
-rw-r--r-- | audio/decode/ad_spdif.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |