File: internal.cpp

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (48 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download | duplicates (2)
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

#include "cutscene/ffmpeg/internal.h"


namespace cutscene {
namespace ffmpeg {
DecoderStatus::DecoderStatus() {}

DecoderStatus::~DecoderStatus() {
	videoStreamIndex = -1;
	videoStream = nullptr;
	videoCodec = nullptr;

	if (videoCodecCtx != nullptr) {
		avcodec_close(videoCodecCtx);
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
		avcodec_free_context(&videoCodecCtx);
#endif
		videoCodecCtx = nullptr;
	}

	audioStreamIndex = -1;
	audioStream = nullptr;
	audioCodec = nullptr;

	if (audioCodecCtx != nullptr) {
		avcodec_close(audioCodecCtx);
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
		avcodec_free_context(&audioCodecCtx);
#endif
		audioCodecCtx = nullptr;
	}

	subtitleStreamIndex = -1;
	subtitleStream = nullptr;
	subtitleCodec = nullptr;

	if (subtitleCodecCtx != nullptr) {
		avcodec_close(subtitleCodecCtx);
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(57, 24, 255)
		avcodec_free_context(&subtitleCodecCtx);
#endif
		subtitleCodecCtx = nullptr;
	}
}

} // namespace ffmpeg
} // namespace cutscene