1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

try to fix travis build.

What an ancient version of ffmpeg does it have?
This commit is contained in:
AlexVinS 2015-11-11 15:44:17 +03:00
parent f9dfa8d0c2
commit e20f861727
2 changed files with 24 additions and 10 deletions

View File

@ -142,14 +142,9 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
return false;
}
// Allocate video frame
#ifdef VCMI_USE_OLD_AVUTIL
frame = avcodec_alloc_frame();
#else
frame = av_frame_alloc();
#endif
//setup scaling
if(scale)
{
pos.w = screen->w;
@ -362,12 +357,7 @@ void CVideoPlayer::close()
if (frame)
{
#ifdef VCMI_USE_OLD_AVUTIL
av_free(frame);
frame = nullptr;
#else
av_frame_free(&frame);//will be set to null
#endif
}
if (codec)

View File

@ -58,6 +58,30 @@ extern "C" {
#define VCMI_USE_OLD_AVUTIL
#endif // LIBSWSCALE_VERSION_INT
#ifdef VCMI_USE_OLD_AVUTIL
#define AVPixelFormat PixelFormat
#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
#define AV_PIX_FMT_BGR565 PIX_FMT_BGR565
#define AV_PIX_FMT_BGR24 PIX_FMT_BGR24
#define AV_PIX_FMT_BGR32 PIX_FMT_BGR32
#define AV_PIX_FMT_RGB565 PIX_FMT_RGB565
#define AV_PIX_FMT_RGB24 PIX_FMT_RGB24
#define AV_PIX_FMT_RGB32 PIX_FMT_RGB32
inline AVFrame * av_frame_alloc()
{
return avcodec_alloc_frame();
}
inline void av_frame_free(AVFrame ** frame)
{
av_free(*frame);
*frame = nullptr;
}
#endif // VCMI_USE_OLD_AVUTIL
class CVideoPlayer : public IMainVideoPlayer
{
int stream; // stream index in video