mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
Fix compilation issue with older ffmpeg versions
This commit is contained in:
parent
eab2a1a733
commit
a13fb0e8ca
@ -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");
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user