mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
fix avcodec deprecation warnings
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user