Skip to content

Commit 955365c

Browse files
committed
Merge 3 into 4
Signed-off-by: Addisu Z. Taddese <[email protected]>
2 parents 454595b + ac3fd97 commit 955365c

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

av/src/AudioDecoder.cc

Lines changed: 10 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)
@@ -157,7 +163,11 @@ bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize)
157163
// decodedFrame->linesize[0].
158164
int size = decodedFrame->nb_samples *
159165
av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) *
166+
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100)
160167
this->data->codecCtx->ch_layout.nb_channels;
168+
#else
169+
this->data->codecCtx->channels;
170+
#endif
161171
// Resize the audio buffer as necessary
162172
if (*_outBufferSize + size > maxBufferSize)
163173
{

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
@@ -142,6 +142,10 @@ namespace ignition
142142
/// std::cout << "Type++ Name[" << myTypeIface.Str(*i) << "]\n";
143143
/// }
144144
/// \verbatim
145+
#if defined __APPLE__ && defined __clang__
146+
_Pragma("clang diagnostic push")
147+
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
148+
#endif
145149
template<typename Enum>
146150
class EnumIterator
147151
: std::iterator<std::bidirectional_iterator_tag, Enum>
@@ -219,6 +223,9 @@ namespace ignition
219223
/// member value ever used.
220224
private: Enum c;
221225
};
226+
#if defined __APPLE__ && defined __clang__
227+
_Pragma("clang diagnostic pop")
228+
#endif
222229

223230
/// \brief Equality operator
224231
/// \param[in] _e1 First iterator

0 commit comments

Comments
 (0)