Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libadm throws an error if formalLabel is not 0 or 1 #187

Open
rsjbailey opened this issue Jan 11, 2024 · 0 comments
Open

libadm throws an error if formalLabel is not 0 or 1 #187

rsjbailey opened this issue Jan 11, 2024 · 0 comments

Comments

@rsjbailey
Copy link
Contributor

rsjbailey commented Jan 11, 2024

An audioTrackFormat representing some custom codec might have user-defined formatLabel and formatDefinition attributes (see 2076-2 page 80).

libadm throws a parsing error if it encounters anything other than formatDefinition=0000 formatLabel=Undefined or formatDefinition=0001 formatLabel=PCM despite other values being valid.

FormatDescriptor parseFormatLabel(const std::string& label) {
if (label == "0000") {
return FormatDefinition::UNDEFINED;
} else if (label == "0001") {
return FormatDefinition::PCM;
} else {
std::stringstream errorString;
errorString << "invalid formatLabel: " << label;
throw std::runtime_error(errorString.str());
}
}
FormatDescriptor parseFormatDefinition(const std::string& definition) {
if (definition == "Undefined") {
return FormatDefinition::UNDEFINED;
} else if (definition == "PCM") {
return FormatDefinition::PCM;
} else {
std::stringstream errorString;
errorString << "invalid formatDefinition: " << definition;
throw std::runtime_error(errorString.str());
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant