Skip to content

Commit

Permalink
Fix deprecation warnings (#603)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored May 7, 2024
1 parent e1a21e0 commit ac3fd97
Show file tree
Hide file tree
Showing 3 changed files with 17 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 @@ -67,7 +67,13 @@ void AudioDecoder::Cleanup()
{
// Close the codec
if (this->data->codecCtx)
{
#if LIBAVFORMAT_VERSION_MAJOR < 59
avcodec_close(this->data->codecCtx);
#else
avcodec_free_context(&this->data->codecCtx);
#endif
}

// Close the audio file
if (this->data->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 @@ -83,7 +83,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
7 changes: 7 additions & 0 deletions include/gz/common/EnumIface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ namespace ignition
/// std::cout << "Type++ Name[" << myTypeIface.Str(*i) << "]\n";
/// }
/// \verbatim
#if defined __APPLE__ && defined __clang__
_Pragma("clang diagnostic push")
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#endif
template<typename Enum>
class EnumIterator
: std::iterator<std::bidirectional_iterator_tag, Enum>
Expand Down Expand Up @@ -217,6 +221,9 @@ namespace ignition
/// member value ever used.
private: Enum c;
};
#if defined __APPLE__ && defined __clang__
_Pragma("clang diagnostic pop")
#endif

/// \brief Equality operator
/// \param[in] _e1 First iterator
Expand Down

0 comments on commit ac3fd97

Please sign in to comment.