Skip to content

Commit ac3fd97

Browse files
authored
Fix deprecation warnings (#603)
Signed-off-by: Addisu Z. Taddese <[email protected]>
1 parent e1a21e0 commit ac3fd97

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

av/src/AudioDecoder.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ void AudioDecoder::Cleanup()
6767
{
6868
// Close the codec
6969
if (this->data->codecCtx)
70+
{
71+
#if LIBAVFORMAT_VERSION_MAJOR < 59
7072
avcodec_close(this->data->codecCtx);
73+
#else
74+
avcodec_free_context(&this->data->codecCtx);
75+
#endif
76+
}
7177

7278
// Close the audio file
7379
if (this->data->formatCtx)

av/src/Video.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ void Video::Cleanup()
8383
avformat_close_input(&this->dataPtr->formatCtx);
8484

8585
// Close the codec
86+
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
87+
avcodec_free_context(&this->dataPtr->codecCtx);
88+
#else
8689
avcodec_close(this->dataPtr->codecCtx);
90+
#endif
8791

8892
av_free(this->dataPtr->avFrameDst);
8993
}

include/gz/common/EnumIface.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ namespace ignition
140140
/// std::cout << "Type++ Name[" << myTypeIface.Str(*i) << "]\n";
141141
/// }
142142
/// \verbatim
143+
#if defined __APPLE__ && defined __clang__
144+
_Pragma("clang diagnostic push")
145+
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
146+
#endif
143147
template<typename Enum>
144148
class EnumIterator
145149
: std::iterator<std::bidirectional_iterator_tag, Enum>
@@ -217,6 +221,9 @@ namespace ignition
217221
/// member value ever used.
218222
private: Enum c;
219223
};
224+
#if defined __APPLE__ && defined __clang__
225+
_Pragma("clang diagnostic pop")
226+
#endif
220227

221228
/// \brief Equality operator
222229
/// \param[in] _e1 First iterator

0 commit comments

Comments
 (0)