-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
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.
libadm/src/elements/format_descriptor.cpp
Lines 12 to 34 in 3f94a9b
| 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()); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels