decoder/ffmpeg: use AVCodecParameters on FFmpeg 3.1
The AVCodecContext attribute is deprecated.
This commit is contained in:
parent
8412d94d05
commit
a3d020eff9
1
NEWS
1
NEWS
|
@ -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 ¶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)
|
||||
|
|
Loading…
Reference in New Issue