diff options
author | Max Kellermann <max@duempel.org> | 2016-07-27 15:06:42 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-07-28 19:50:25 +0200 |
commit | a3d020eff9ee88f5f990dbf914c037e285cdba8e (patch) | |
tree | fb763cd7d199105ccb10159e9f479af31dab3bc6 /src/decoder | |
parent | 8412d94d0580924655eb2f6345be7959166a1d92 (diff) |
decoder/ffmpeg: use AVCodecParameters on FFmpeg 3.1
The AVCodecContext attribute is deprecated.
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/plugins/FfmpegDecoderPlugin.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index ad6657a2d..92ac764e8 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -76,6 +76,24 @@ ffmpeg_init(gcc_unused const config_param ¶m) return true; } +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 5, 0) + +gcc_pure +static const AVCodecParameters & +GetCodecParameters(const AVStream &stream) +{ + return *stream.codecpar; +} + +gcc_pure +static AVSampleFormat +GetSampleFormat(const AVCodecParameters &codec_params) +{ + return AVSampleFormat(codec_params.format); +} + +#else + gcc_pure static const AVCodecContext & GetCodecParameters(const AVStream &stream) @@ -90,6 +108,8 @@ GetSampleFormat(const AVCodecContext &codec_context) return codec_context.sample_fmt; } +#endif + gcc_pure static bool IsAudio(const AVStream &stream) |