Fixed compile with older versions of libavcodec.

This commit is contained in:
casey langen 2020-01-10 17:46:51 -08:00
parent c797e00c1a
commit e420e32d05

View File

@ -113,15 +113,13 @@ class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory {
".wav", ".wave", ".aif", ".aiff"
};
const AVCodec* codec = nullptr;
void *i = 0;
while ((codec = av_codec_iterate(&i))) {
if (av_codec_is_decoder(codec)) {
const AVCodecDescriptor* descriptor = avcodec_descriptor_get(codec->id);
if (descriptor != nullptr && descriptor->type == AVMEDIA_TYPE_AUDIO) {
supported.insert(descriptor->id);
}
AVCodec* codec = av_codec_next(nullptr);
while (codec != nullptr) {
const AVCodecDescriptor* descriptor = avcodec_descriptor_get(codec->id);
if (descriptor != nullptr && descriptor->type == AVMEDIA_TYPE_AUDIO) {
supported.insert(descriptor->id);
}
codec = av_codec_next(codec);
}
}