blob: 087c6bb1ccec3548177179db2e7a560fa618f0b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
From c53c53642b40c82e40fd87905f4d8edb67b617cc Mon Sep 17 00:00:00 2001
From: AlexVinS <alexvins@users.noreply.github.com>
Date: Wed, 11 Nov 2015 12:41:28 +0300
Subject: [PATCH] Hopefully proper fix for ffmpeg on MSVS
---
client/CVideoHandler.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/client/CVideoHandler.cpp b/client/CVideoHandler.cpp
index 4ccaf0e..a7770e7 100644
--- a/client/CVideoHandler.cpp
+++ b/client/CVideoHandler.cpp
@@ -155,11 +155,12 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
}
// Allocate video frame
-#if LIBAVUTIL_VERSION_MAJOR > 52
- frame = av_alloc_frame();
+#if LIBAVUTIL_VERSION_MAJOR > 51
+ frame = av_frame_alloc();
#else
frame = avcodec_alloc_frame();
#endif
+
//setup scaling
@@ -436,12 +437,12 @@ void CVideoPlayer::close()
if (frame)
{
-#if LIBAVUTIL_VERSION_MAJOR > 52
- av_frame_free(frame);
+#if LIBAVUTIL_VERSION_MAJOR > 51
+ av_frame_free(&frame);//will be set to null
#else
av_free(frame);
+ frame = nullptr;
#endif
- frame = nullptr;
}
if (codec)
--
2.9.3
|