Fixed wav/aiff pcm support in ffmpeg parser
This commit is contained in:
@@ -81,7 +81,7 @@ namespace lms::audio::ffmpeg
|
||||
|
||||
std::optional<core::media::Container> avdemuxerToContainerType(std::string_view name)
|
||||
{
|
||||
if (name == "aiff")
|
||||
if (name == "aiff" || name == "aifc" || name == "aif")
|
||||
return core::media::Container::AIFF;
|
||||
if (name == "ape")
|
||||
return core::media::Container::APE;
|
||||
@@ -142,6 +142,39 @@ namespace lms::audio::ffmpeg
|
||||
return core::media::Codec::MPC8;
|
||||
case AV_CODEC_ID_OPUS:
|
||||
return core::media::Codec::Opus;
|
||||
case AV_CODEC_ID_PCM_S16LE:
|
||||
case AV_CODEC_ID_PCM_S16BE:
|
||||
case AV_CODEC_ID_PCM_U16LE:
|
||||
case AV_CODEC_ID_PCM_U16BE:
|
||||
case AV_CODEC_ID_PCM_S8:
|
||||
case AV_CODEC_ID_PCM_U8:
|
||||
case AV_CODEC_ID_PCM_S32LE:
|
||||
case AV_CODEC_ID_PCM_S32BE:
|
||||
case AV_CODEC_ID_PCM_U32LE:
|
||||
case AV_CODEC_ID_PCM_U32BE:
|
||||
case AV_CODEC_ID_PCM_S24LE:
|
||||
case AV_CODEC_ID_PCM_S24BE:
|
||||
case AV_CODEC_ID_PCM_U24LE:
|
||||
case AV_CODEC_ID_PCM_U24BE:
|
||||
case AV_CODEC_ID_PCM_S16LE_PLANAR:
|
||||
case AV_CODEC_ID_PCM_F32BE:
|
||||
case AV_CODEC_ID_PCM_F32LE:
|
||||
case AV_CODEC_ID_PCM_F64BE:
|
||||
case AV_CODEC_ID_PCM_F64LE:
|
||||
case AV_CODEC_ID_PCM_S8_PLANAR:
|
||||
case AV_CODEC_ID_PCM_S24LE_PLANAR:
|
||||
case AV_CODEC_ID_PCM_S32LE_PLANAR:
|
||||
case AV_CODEC_ID_PCM_S16BE_PLANAR:
|
||||
case AV_CODEC_ID_PCM_S64LE:
|
||||
case AV_CODEC_ID_PCM_S64BE:
|
||||
case AV_CODEC_ID_PCM_F16LE:
|
||||
case AV_CODEC_ID_PCM_F24LE:
|
||||
case AV_CODEC_ID_PCM_MULAW:
|
||||
case AV_CODEC_ID_PCM_ALAW:
|
||||
case AV_CODEC_ID_ADPCM_G726:
|
||||
case AV_CODEC_ID_ADPCM_G722:
|
||||
case AV_CODEC_ID_ADPCM_G726LE:
|
||||
return core::media::Codec::PCM;
|
||||
case AV_CODEC_ID_SHORTEN:
|
||||
return core::media::Codec::Shorten;
|
||||
case AV_CODEC_ID_VORBIS:
|
||||
|
||||
@@ -24,10 +24,11 @@ namespace lms::audio::ffmpeg::utils
|
||||
std::span<const std::filesystem::path> getSupportedExtensions()
|
||||
{
|
||||
// TODO: list demuxers to retrieve supported formats
|
||||
static const std::array<std::filesystem::path, 18> fileExtensions{
|
||||
static const std::array<std::filesystem::path, 19> fileExtensions{
|
||||
".aac",
|
||||
".alac",
|
||||
".aif",
|
||||
".aifc",
|
||||
".aiff",
|
||||
".ape",
|
||||
".dsf",
|
||||
|
||||
@@ -212,12 +212,14 @@ namespace lms::audio::taglib
|
||||
}
|
||||
else if (const auto* aiffFile{ dynamic_cast<const ::TagLib::RIFF::AIFF::File*>(&file) })
|
||||
{
|
||||
// We don't check for potential Aiff-C format here, we considerer it PCM for now
|
||||
audioProperties.container = core::media::Container::AIFF;
|
||||
audioProperties.codec = core::media::Codec::PCM;
|
||||
audioProperties.bitsPerSample = aiffFile->audioProperties()->bitsPerSample();
|
||||
}
|
||||
else if (const auto* wavFile{ dynamic_cast<const ::TagLib::RIFF::WAV::File*>(&file) })
|
||||
{
|
||||
// We don't check for format here, we considerer it PCM for now
|
||||
audioProperties.container = core::media::Container::WAV;
|
||||
audioProperties.codec = core::media::Codec::PCM;
|
||||
audioProperties.bitsPerSample = wavFile->audioProperties()->bitsPerSample();
|
||||
|
||||
Reference in New Issue
Block a user