Commit a3d020ef authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: use AVCodecParameters on FFmpeg 3.1

The AVCodecContext attribute is deprecated.
parent 8412d94d
......@@ -2,6 +2,7 @@ ver 0.19.18 (not yet released)
* decoder
- ffmpeg: fix crash with older FFmpeg versions (< 3.0)
- ffmpeg: log detailed error message
- ffmpeg: support FFmpeg 3.1
ver 0.19.17 (2016/07/09)
* decoder
......
......@@ -76,6 +76,24 @@ ffmpeg_init(gcc_unused const config_param &param)
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment