diff --git a/src/plugins/ffmpegdecoder/plugin.cpp b/src/plugins/ffmpegdecoder/plugin.cpp index f2507cd39..03a4eea0f 100644 --- a/src/plugins/ffmpegdecoder/plugin.cpp +++ b/src/plugins/ffmpegdecoder/plugin.cpp @@ -85,8 +85,6 @@ class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory { CoInitializeEx(nullptr, COINIT_MULTITHREADED); #endif - av_register_all(); - typeToCodecId = { { ".mp3", AV_CODEC_ID_MP3 }, { "audio/mpeg", AV_CODEC_ID_MP3 }, @@ -117,13 +115,13 @@ class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory { ".wav", ".wave", ".aif", ".aiff" }; - AVCodec* codec = av_codec_next(nullptr); - while (codec != nullptr) { + void* iterator = nullptr; + const AVCodec* codec = nullptr; + while ((codec = av_codec_iterate(&iterator))) { 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); } } diff --git a/src/plugins/stockencoders/FfmpegEncoder.cpp b/src/plugins/stockencoders/FfmpegEncoder.cpp index 2aa251dd2..a406b9f05 100644 --- a/src/plugins/stockencoders/FfmpegEncoder.cpp +++ b/src/plugins/stockencoders/FfmpegEncoder.cpp @@ -361,10 +361,6 @@ bool FfmpegEncoder::OpenOutputContext() { } bool FfmpegEncoder::Initialize(IDataStream* out, size_t rate, size_t channels, size_t bitrate) { -#ifndef WIN32 - av_register_all(); -#endif - this->out = out; if (this->OpenOutputContext()) {