Fix compilation issue with older ffmpeg versions

This commit is contained in:
rdb 2016-12-21 17:33:22 +01:00
parent eab2a1a733
commit a13fb0e8ca
2 changed files with 10 additions and 1 deletions

View File

@ -46,6 +46,10 @@ PStatCollector FfmpegVideoCursor::_export_frame_pcollector("*:FFMPEG Convert Vid
#define AV_PIX_FMT_BGRA PIX_FMT_BGRA
#endif
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 32, 100)
#define AV_PIX_FMT_FLAG_ALPHA PIX_FMT_FLAG_ALPHA
#endif
/**
* This constructor is only used when reading from a bam file.
*/
@ -512,7 +516,7 @@ open_stream() {
AVCodec *pVideoCodec = NULL;
if (ffmpeg_prefer_libvpx) {
if (_video_ctx->codec_id == AV_CODEC_ID_VP9) {
if ((int)_video_ctx->codec_id == 168) { // AV_CODEC_ID_VP9
pVideoCodec = avcodec_find_decoder_by_name("libvpx-vp9");
} else if (_video_ctx->codec_id == AV_CODEC_ID_VP8) {
pVideoCodec = avcodec_find_decoder_by_name("libvpx");

View File

@ -104,7 +104,12 @@ private:
int _max_readahead_frames;
ThreadPriority _thread_priority;
PT(GenericThread) _thread;
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 74, 100)
PixelFormat _pixel_format;
#else
AVPixelFormat _pixel_format;
#endif
// This global Mutex protects calls to avcodec_opencloseetc.
static ReMutex _av_lock;