mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-03 14:38:08 +00:00
Remove deprecated APIs to support ffmpeg5.
This commit is contained in:
parent
6f7b86f930
commit
6c1870edc3
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user