File: ffmpeg8.patch

package info (click to toggle)
freespace2 24.2.0%2Brepack-3
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,740 kB
  • sloc: cpp: 595,005; ansic: 21,741; python: 1,174; sh: 457; makefile: 243; xml: 181
file content (57 lines) | stat: -rw-r--r-- 1,690 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
57
Description: fix avcodec deprecation warnings
Author: Taylor Richards <taylor@notimaginative.com>
Origin: upstream
Applied-Upstream: af833f059cc0cfc925792e019f6c2b754c6d53c1
Forwarded: not-needed
--- a/code/cutscene/ffmpeg/internal.cpp
+++ b/code/cutscene/ffmpeg/internal.cpp
@@ -12,9 +12,10 @@ DecoderStatus::~DecoderStatus() {
 	videoCodec = nullptr;
 
 	if (videoCodecCtx != nullptr) {
-		avcodec_close(videoCodecCtx);
 #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
 		avcodec_free_context(&videoCodecCtx);
+#else
+		avcodec_close(videoCodecCtx);
 #endif
 		videoCodecCtx = nullptr;
 	}
@@ -24,9 +25,10 @@ DecoderStatus::~DecoderStatus() {
 	audioCodec = nullptr;
 
 	if (audioCodecCtx != nullptr) {
-		avcodec_close(audioCodecCtx);
 #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
 		avcodec_free_context(&audioCodecCtx);
+#else
+		avcodec_close(audioCodecCtx);
 #endif
 		audioCodecCtx = nullptr;
 	}
@@ -36,9 +38,10 @@ DecoderStatus::~DecoderStatus() {
 	subtitleCodec = nullptr;
 
 	if (subtitleCodecCtx != nullptr) {
-		avcodec_close(subtitleCodecCtx);
 #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
 		avcodec_free_context(&subtitleCodecCtx);
+#else
+		avcodec_close(subtitleCodecCtx);
 #endif
 		subtitleCodecCtx = nullptr;
 	}
--- a/code/sound/ffmpeg/FFmpegWaveFile.cpp
+++ b/code/sound/ffmpeg/FFmpegWaveFile.cpp
@@ -151,9 +151,10 @@ FFmpegWaveFile::~FFmpegWaveFile()
 	av_frame_free(&m_decodeFrame);
 
 	if (m_audioCodecCtx) {
-		avcodec_close(m_audioCodecCtx);
 #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
 		avcodec_free_context(&m_audioCodecCtx);
+#else
+		avcodec_close(m_audioCodecCtx);
 #endif
 		m_audioCodecCtx = nullptr;
 	}