mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-23 12:08:45 +02:00
try to fix libav 9.18
This commit is contained in:
parent
33c933c208
commit
f9dfa8d0c2
@ -141,9 +141,12 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
|
|||||||
codec = nullptr;
|
codec = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate video frame
|
// Allocate video frame
|
||||||
|
#ifdef VCMI_USE_OLD_AVUTIL
|
||||||
|
frame = avcodec_alloc_frame();
|
||||||
|
#else
|
||||||
frame = av_frame_alloc();
|
frame = av_frame_alloc();
|
||||||
|
#endif
|
||||||
|
|
||||||
//setup scaling
|
//setup scaling
|
||||||
|
|
||||||
@ -359,7 +362,12 @@ void CVideoPlayer::close()
|
|||||||
|
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
|
#ifdef VCMI_USE_OLD_AVUTIL
|
||||||
|
av_free(frame);
|
||||||
|
frame = nullptr;
|
||||||
|
#else
|
||||||
av_frame_free(&frame);//will be set to null
|
av_frame_free(&frame);//will be set to null
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codec)
|
if (codec)
|
||||||
|
@ -53,6 +53,11 @@ extern "C" {
|
|||||||
#include <libswscale/swscale.h>
|
#include <libswscale/swscale.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//compatibility for libav 9.18 in ubuntu 14.04, 52.66.100 is ffmpeg 2.2.3
|
||||||
|
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 66, 100)
|
||||||
|
#define VCMI_USE_OLD_AVUTIL
|
||||||
|
#endif // LIBSWSCALE_VERSION_INT
|
||||||
|
|
||||||
class CVideoPlayer : public IMainVideoPlayer
|
class CVideoPlayer : public IMainVideoPlayer
|
||||||
{
|
{
|
||||||
int stream; // stream index in video
|
int stream; // stream index in video
|
||||||
|
Loading…
x
Reference in New Issue
Block a user