Skip to content

Commit

Permalink
Merge pull request #605 from azeey/4_to_5
Browse files Browse the repository at this point in the history
Merge ign-common4 ➡️  gz-common5
  • Loading branch information
azeey authored May 8, 2024
2 parents 27ee4d6 + dc6d01c commit e79bc54
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 e79bc54

Please sign in to comment.