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