From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 10 Jun 2023 16:10:02 +0000 (+0100) Subject: stop two FFmpeg deprecation warnings X-Git-Tag: 4.3~1^2~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17414f576db69b9bb6ad1708ebe42765c2da6414;p=thirdparty%2Fshairport-sync.git stop two FFmpeg deprecation warnings --- diff --git a/rtp.c b/rtp.c index 7f9ebe83..ed64ea74 100644 --- a/rtp.c +++ b/rtp.c @@ -2916,14 +2916,25 @@ void *rtp_buffered_audio_processor(void *arg) { else if (ret < 0) { debug(1, "error %d during decoding", ret); } else { +#if LIBAVUTIL_VERSION_MAJOR >= 57 + av_samples_alloc(&pcm_audio, &dst_linesize, codec_context->ch_layout.nb_channels, + decoded_frame->nb_samples, av_format, 1); +#else av_samples_alloc(&pcm_audio, &dst_linesize, codec_context->channels, decoded_frame->nb_samples, av_format, 1); +#endif // remember to free pcm_audio ret = swr_convert(swr, &pcm_audio, decoded_frame->nb_samples, (const uint8_t **)decoded_frame->extended_data, decoded_frame->nb_samples); +#if LIBAVUTIL_VERSION_MAJOR >= 57 + dst_bufsize = av_samples_get_buffer_size( + &dst_linesize, codec_context->ch_layout.nb_channels, ret, av_format, 1); +#else dst_bufsize = av_samples_get_buffer_size( &dst_linesize, codec_context->channels, ret, av_format, 1); +#endif + // debug(1,"generated %d bytes of PCM", dst_bufsize); // copy the PCM audio into the PCM buffer. // make sure it's big enough first