fix ffm 7.xx

Origin commit data
------------------
Branch: ni/coolstream
Commit: c9c72541b5
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2025-06-22 (Sun, 22 Jun 2025)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
BPanther
2025-06-22 20:36:24 +02:00
committed by vanhofen
parent 0d1ee0dbca
commit 6f6f3114c3
2 changed files with 12 additions and 1 deletions

View File

@@ -197,9 +197,14 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void)
cDvbSubtitleConverter::~cDvbSubtitleConverter() cDvbSubtitleConverter::~cDvbSubtitleConverter()
{ {
if (avctx) { if (avctx)
{
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100)
avcodec_close(avctx); avcodec_close(avctx);
av_free(avctx); av_free(avctx);
#else
avcodec_free_context(&avctx);
#endif
avctx = NULL; avctx = NULL;
} }
delete bitmaps; delete bitmaps;

View File

@@ -218,6 +218,7 @@ void CFfmpegDec::DeInit(void)
{ {
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100) #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100)
avcodec_close(c); avcodec_close(c);
avcodec_free_context(&c);
#else #else
avcodec_free_context(&c); avcodec_free_context(&c);
#endif #endif
@@ -285,7 +286,12 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state,
SwrContext *swr = swr_alloc(); SwrContext *swr = swr_alloc();
if (!swr) { if (!swr) {
mutex.lock(); mutex.lock();
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100)
avcodec_close(c); avcodec_close(c);
avcodec_free_context(&c);
#else
avcodec_free_context(&c);
#endif
mutex.unlock(); mutex.unlock();
DeInit(); DeInit();
Status=DATA_ERR; Status=DATA_ERR;