mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-27 13:53:01 +00:00
encoder/ffmpeg: Remove legacy API usage (#783)
The build breaks if compiling against a newer version of ffmpeg which does not define the FF_API_NEXT macro and has fully removed the av_codec_next() API.
This commit is contained in:
parent
03b16786e7
commit
f93d5c2202
1 changed files with 0 additions and 17 deletions
|
@ -1180,7 +1180,6 @@ ffmpeg_manager::~ffmpeg_manager()
|
|||
void ffmpeg_manager::register_encoders()
|
||||
{
|
||||
// Encoders
|
||||
#if FF_API_NEXT
|
||||
void* iterator = nullptr;
|
||||
for (const AVCodec* codec = av_codec_iterate(&iterator); codec != nullptr; codec = av_codec_iterate(&iterator)) {
|
||||
// Only register encoders.
|
||||
|
@ -1195,22 +1194,6 @@ void ffmpeg_manager::register_encoders()
|
|||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
AVCodec* codec = nullptr;
|
||||
for (codec = av_codec_next(codec); codec != nullptr; codec = av_codec_next(codec)) {
|
||||
// Only register encoders.
|
||||
if (!av_codec_is_encoder(codec))
|
||||
continue;
|
||||
|
||||
if ((codec->type == AVMediaType::AVMEDIA_TYPE_AUDIO) || (codec->type == AVMediaType::AVMEDIA_TYPE_VIDEO)) {
|
||||
try {
|
||||
_factories.emplace(codec, std::make_shared<ffmpeg_factory>(codec));
|
||||
} catch (const std::exception& ex) {
|
||||
DLOG_ERROR("Failed to register encoder '%s': %s", codec->name, ex.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ffmpeg_manager::register_handler(std::string codec, std::shared_ptr<handler::handler> handler)
|
||||
|
|
Loading…
Reference in a new issue