diff --git a/panda/src/ffmpeg/ffmpegAudioCursor.cxx b/panda/src/ffmpeg/ffmpegAudioCursor.cxx index 4eab28e4b6..a33db26b6f 100644 --- a/panda/src/ffmpeg/ffmpegAudioCursor.cxx +++ b/panda/src/ffmpeg/ffmpegAudioCursor.cxx @@ -148,7 +148,11 @@ FfmpegAudioCursor(FfmpegAudio *src) : _can_seek = true; _can_seek_fast = true; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100) + _frame = av_frame_alloc(); +#else _frame = avcodec_alloc_frame(); +#endif _packet = new AVPacket; _buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2; @@ -194,7 +198,9 @@ FfmpegAudioCursor:: void FfmpegAudioCursor:: cleanup() { if (_frame) { -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100) +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101) + av_frame_free(&_frame); +#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100) avcodec_free_frame(&_frame); #else av_free(&_frame); diff --git a/panda/src/ffmpeg/ffmpegVideoCursor.cxx b/panda/src/ffmpeg/ffmpegVideoCursor.cxx index a02dac184b..87b3b48395 100644 --- a/panda/src/ffmpeg/ffmpegVideoCursor.cxx +++ b/panda/src/ffmpeg/ffmpegVideoCursor.cxx @@ -94,8 +94,13 @@ init_from(FfmpegVideo *source) { PIX_FMT_BGR24, SWS_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL); #endif // HAVE_SWSCALE +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100) + _frame = av_frame_alloc(); + _frame_out = av_frame_alloc(); +#else _frame = avcodec_alloc_frame(); _frame_out = avcodec_alloc_frame(); +#endif if ((_frame == 0)||(_frame_out == 0)) { cleanup();