Skip to content

Commit 754947a

Browse files
committed
vdisp/file: avoid deprecated AVCodec::sample_fmts
see the also the commit 8b94de5 (2024-11-12)
1 parent 164084f commit 754947a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/video_display/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ configure_audio(struct state_file *s, struct audio_desc aud_desc,
496496
s->audio.enc = avcodec_alloc_context3(codec);
497497
s->audio.enc->sample_fmt =
498498
s->is_nut ? audio_bps_to_av_sample_fmt(aud_desc.bps, false)
499-
: select_sample_format(s->audio.enc->codec->sample_fmts);
499+
: select_sample_format(
500+
avc_get_supported_sample_fmts(s->audio.enc, NULL));
500501
aud_ctx_set_ch_layout(s->audio.enc, aud_desc.ch_count, s->is_nut);
501502
s->audio.enc->sample_rate = aud_desc.sample_rate;
502503
s->audio.st->time_base = (AVRational){ 1, aud_desc.sample_rate };

0 commit comments

Comments
 (0)