[Libav-user] AVCodec::sample_fmts is deprecated

Gustav González xtingray at gmail.com
Sun Mar 16 05:22:06 EET 2025


Hi,
Currently, I am trying to update the source code of my project and need to
replace the sample_fmts attribute that was deprecated from the AvCodec
implementation (FFmpeg 7.1):

tffmpegmoviegenerator.cpp:563:71: warning: ‘AVCodec::sample_fmts’ is
deprecated [-Wdeprecated-declarations]
  563 |     const enum AVSampleFormat *test =
audioOutputCodecContext->codec->sample_fmts;
      |
  ^~~~~~~~~~~
In file included from /usr/local/ffmpeg/include/libavcodec/avcodec.h:41,
                 from tffmpegmoviegenerator.h:45,
                 from tffmpegmoviegenerator.cpp:39:
/usr/local/ffmpeg/include/libavcodec/codec.h:219:32: note: declared here
  219 |     const enum AVSampleFormat *sample_fmts; ///< @deprecated use
avcodec_get_supported_config()

I was trying to find an example of how to replace the sample_fmts variable
using the new method avcodec_get_supported_config(), but I couldn't find it.

Any help or hint would be appreciated. Thanks.

--
  Gustav Gonzalez
  xtingray at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20250315/b7ff0b15/attachment.htm>


More information about the Libav-user mailing list