decoder/ffmpeg: check for DSD codec

DSD uses a generic demuxer, therefore it does not appear in the
demuxer list.
This commit is contained in:
Max Kellermann 2023-03-12 19:34:55 +01:00
parent 3c798b4907
commit c53ee41855
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include "util/IterableSplitString.hxx"
#include "util/ScopeExit.hxx"
#include "util/StringAPI.hxx"
#include "util/StringCompare.hxx"
#include "Log.hxx"
extern "C" {
@ -705,6 +706,15 @@ ffmpeg_suffixes() noexcept
suffixes.emplace(input_format->name);
}
void *codec_opaque = nullptr;
while (const auto codec = av_codec_iterate(&codec_opaque)) {
if (StringStartsWith(codec->name, "dsd_")) {
/* FFmpeg was compiled with DSD support */
suffixes.emplace("dff");
suffixes.emplace("dsf");
}
}
return suffixes;
}