Skip to content

Commit

Permalink
vdisp/file: avoid deprecated AVCodec::sample_fmts
Browse files Browse the repository at this point in the history
see the also the commit 8b94de5 (2024-11-12)
  • Loading branch information
MartinPulec committed Nov 14, 2024
1 parent 164084f commit 754947a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video_display/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ configure_audio(struct state_file *s, struct audio_desc aud_desc,
s->audio.enc = avcodec_alloc_context3(codec);
s->audio.enc->sample_fmt =
s->is_nut ? audio_bps_to_av_sample_fmt(aud_desc.bps, false)
: select_sample_format(s->audio.enc->codec->sample_fmts);
: select_sample_format(
avc_get_supported_sample_fmts(s->audio.enc, NULL));
aud_ctx_set_ch_layout(s->audio.enc, aud_desc.ch_count, s->is_nut);
s->audio.enc->sample_rate = aud_desc.sample_rate;
s->audio.st->time_base = (AVRational){ 1, aud_desc.sample_rate };
Expand Down

0 comments on commit 754947a

Please sign in to comment.