Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/internal_modules/roc_audio/sample_spec_parse.rl
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ bool parse_sample_spec_imp(const char* str, SampleSpec& sample_spec) {
sample_spec.set_sample_rate(rate);
}

delimiter = [,_\.] | space;
surround_mask = ([a-z] [a-z0-9.]+) >start_token %set_surround_mask;
surround_channel = [A-Z]+ >start_token %set_surround_channel;
surround_list = surround_channel (',' surround_channel)*;
surround_list = surround_channel (delimiter surround_channel)*;

surround = (surround_mask | surround_list) %set_surround;

Expand All @@ -312,15 +313,14 @@ bool parse_sample_spec_imp(const char* str, SampleSpec& sample_spec) {
mtr_range_end = [0-9]+ >start_token %set_mtr_range_end;
mtr_range = (mtr_range_begin '-' mtr_range_end) >start_token %set_mtr_range;
mtr_channel = mtr_number | mtr_range;
mtr_list = mtr_channel (',' mtr_channel)*;
mtr_list = mtr_channel (delimiter mtr_channel)*;

mtr = (mtr_mask | mtr_list) %set_mtr;

format = [a-z0-9_]+ >start_token %set_format;
subformat = [a-z0-9_]+ >start_token %set_subformat;
rate = [0-9]+ >start_token %set_rate;
channels_DISABLED = surround | mtr;
channels = ('stereo' | 'mono') >start_token %set_surround_mask %set_surround;
channels = surround | mtr;

main := ( ('-' | format ('@' subformat)?) '/' ('-' | rate) '/' ('-' | channels) )
%{ success = true; }
Expand Down
2 changes: 1 addition & 1 deletion src/tests/roc_audio/test_sample_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ TEST(sample_spec, parse_format) {
}
}

IGNORE_TEST(sample_spec, parse_channels) {
TEST(sample_spec, parse_channels) {
{ // surround stereo
SampleSpec sample_spec;
CHECK(parse_sample_spec("pcm@s16/48000/stereo", sample_spec));
Expand Down
2 changes: 1 addition & 1 deletion src/tests/roc_rtp/test_encoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace rtp {

TEST_GROUP(encoding) {};

IGNORE_TEST(encoding, parse) {
TEST(encoding, parse) {
Encoding enc;
CHECK(parse_encoding("101:pcm@s18/48000/surround4.1", enc));

Expand Down
Loading