Resampling can use original rate or bit depth

This commit is contained in:
badaix 2020-02-21 21:11:26 +01:00
parent 0de2bbde36
commit de75ad9b2c
4 changed files with 22 additions and 6 deletions

View file

@ -21,6 +21,7 @@
#include <vector>
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
#include "common/str_compat.hpp"
#include "common/utils.hpp"
#include "common/utils/string_utils.hpp"
@ -61,7 +62,9 @@ void SampleFormat::setFormat(const std::string& format)
std::vector<std::string> strs;
strs = utils::string::split(format, ':');
if (strs.size() == 3)
setFormat(cpt::stoul(strs[0]), cpt::stoul(strs[1]), cpt::stoul(strs[2]));
setFormat(strs[0] == "*" ? 0 : cpt::stoul(strs[0]), strs[1] == "*" ? 0 : cpt::stoul(strs[1]), strs[2] == "*" ? 0 : cpt::stoul(strs[2]));
else
throw SnapException("sampleformat must be <rate>:<bits>:<channels>");
}