mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
ffmpeg compatibility fixes
This commit is contained in:
parent
e0ae9b1bc7
commit
48baa5c58e
@ -146,7 +146,7 @@ FfmpegAudioCursor(FfmpegAudio *src) :
|
|||||||
_can_seek = true;
|
_can_seek = true;
|
||||||
_can_seek_fast = true;
|
_can_seek_fast = true;
|
||||||
|
|
||||||
_frame = av_frame_alloc();
|
_frame = avcodec_alloc_frame();
|
||||||
|
|
||||||
_packet = new AVPacket;
|
_packet = new AVPacket;
|
||||||
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
||||||
@ -192,7 +192,11 @@ FfmpegAudioCursor::
|
|||||||
void FfmpegAudioCursor::
|
void FfmpegAudioCursor::
|
||||||
cleanup() {
|
cleanup() {
|
||||||
if (_frame) {
|
if (_frame) {
|
||||||
av_frame_free(&_frame);
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
|
||||||
|
avcodec_free_frame(&_frame);
|
||||||
|
#else
|
||||||
|
av_free(&_frame);
|
||||||
|
#endif
|
||||||
_frame = NULL;
|
_frame = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ open_vfs(const Filename &filename) {
|
|||||||
|
|
||||||
// Now we can open the stream.
|
// Now we can open the stream.
|
||||||
int result =
|
int result =
|
||||||
#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(53, 3, 0)
|
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 4, 0)
|
||||||
avformat_open_input(&_format_context, "", NULL, NULL);
|
avformat_open_input(&_format_context, "", NULL, NULL);
|
||||||
#else
|
#else
|
||||||
av_open_input_file(&_format_context, "", NULL, 0, NULL);
|
av_open_input_file(&_format_context, "", NULL, 0, NULL);
|
||||||
@ -166,7 +166,7 @@ open_subfile(const SubfileInfo &info) {
|
|||||||
|
|
||||||
// Now we can open the stream.
|
// Now we can open the stream.
|
||||||
int result =
|
int result =
|
||||||
#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(53, 3, 0)
|
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 4, 0)
|
||||||
avformat_open_input(&_format_context, fname.c_str(), NULL, NULL);
|
avformat_open_input(&_format_context, fname.c_str(), NULL, NULL);
|
||||||
#else
|
#else
|
||||||
av_open_input_file(&_format_context, fname.c_str(), NULL, 0, NULL);
|
av_open_input_file(&_format_context, fname.c_str(), NULL, 0, NULL);
|
||||||
@ -188,7 +188,7 @@ open_subfile(const SubfileInfo &info) {
|
|||||||
void FfmpegVirtualFile::
|
void FfmpegVirtualFile::
|
||||||
close() {
|
close() {
|
||||||
if (_format_context != NULL) {
|
if (_format_context != NULL) {
|
||||||
#if LIBAVFORMAT_VERSION_MAJOR >= 54
|
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 25, 0)
|
||||||
avformat_close_input(&_format_context);
|
avformat_close_input(&_format_context);
|
||||||
#else
|
#else
|
||||||
av_close_input_file(_format_context);
|
av_close_input_file(_format_context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user