mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
ffmpeg: Use av_frame_* instead of deprecated avcodec_*_frame functions beginning with lavc 55.45.101.
This commit is contained in:
parent
903966371c
commit
f0b3e08e9c
@ -148,7 +148,11 @@ FfmpegAudioCursor(FfmpegAudio *src) :
|
|||||||
_can_seek = true;
|
_can_seek = true;
|
||||||
_can_seek_fast = true;
|
_can_seek_fast = true;
|
||||||
|
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
|
||||||
|
_frame = av_frame_alloc();
|
||||||
|
#else
|
||||||
_frame = avcodec_alloc_frame();
|
_frame = avcodec_alloc_frame();
|
||||||
|
#endif
|
||||||
|
|
||||||
_packet = new AVPacket;
|
_packet = new AVPacket;
|
||||||
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
||||||
@ -194,7 +198,9 @@ FfmpegAudioCursor::
|
|||||||
void FfmpegAudioCursor::
|
void FfmpegAudioCursor::
|
||||||
cleanup() {
|
cleanup() {
|
||||||
if (_frame) {
|
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);
|
avcodec_free_frame(&_frame);
|
||||||
#else
|
#else
|
||||||
av_free(&_frame);
|
av_free(&_frame);
|
||||||
|
@ -94,8 +94,13 @@ init_from(FfmpegVideo *source) {
|
|||||||
PIX_FMT_BGR24, SWS_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL);
|
PIX_FMT_BGR24, SWS_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL);
|
||||||
#endif // HAVE_SWSCALE
|
#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 = avcodec_alloc_frame();
|
||||||
_frame_out = avcodec_alloc_frame();
|
_frame_out = avcodec_alloc_frame();
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((_frame == 0)||(_frame_out == 0)) {
|
if ((_frame == 0)||(_frame_out == 0)) {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user