fix avcodec deprecation warnings

This commit is contained in:
Taylor Richards committed 2025-08-18 12:01:00 -04:00
1 parent d9b7710f92
commit af833f059c
2 files changed
+8 -4

No files matched your search

+6 -3
View File
@@ -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;
}
+2 -1
View File
@@ -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;
}