Skip to content

Commit

Permalink
Merge branch 'gz-common5' into azeey/package_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
azeey authored May 8, 2024
2 parents 17d0e24 + e79bc54 commit 4b48926
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 4b48926

Please sign in to comment.