Skip to content

Commit

Permalink
Merge 4 into 5
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey committed May 7, 2024
2 parents 27ee4d6 + 6dba329 commit dc6d01c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions av/src/AudioDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ common::AudioDecoder::Implementation::~Implementation()
{
// Close the codec
if (this->codecCtx)
{
#if LIBAVFORMAT_VERSION_MAJOR < 59
avcodec_close(this->codecCtx);
#else
avcodec_free_context(&this->codecCtx);
#endif
}

// Close the audio file
if (this->formatCtx)
Expand Down
4 changes: 4 additions & 0 deletions av/src/Video.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ void Video::Cleanup()
avformat_close_input(&this->dataPtr->formatCtx);

// Close the codec
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
avcodec_free_context(&this->dataPtr->codecCtx);
#else
avcodec_close(this->dataPtr->codecCtx);
#endif

av_free(this->dataPtr->avFrameDst);
}
Expand Down

0 comments on commit dc6d01c

Please sign in to comment.