mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
e8fb386456
commit
951153e733
|
@ -196,6 +196,7 @@ static int init_filter(struct mp_filter *da)
|
|||
if (!stream)
|
||||
goto fail;
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue