diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-07-24 10:50:41 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-07-24 10:51:40 +0200 |
commit | 7862ca859932474649b0a933fac7ac20d5ec2da3 (patch) | |
tree | 4963a9dd3f5a4abdc31b861f30300128dace712e /src | |
parent | 956c3e5923ac3c0b149b31aad84c339923f6bc31 (diff) | |
download | ODR-AudioEnc-7862ca859932474649b0a933fac7ac20d5ec2da3.tar.gz ODR-AudioEnc-7862ca859932474649b0a933fac7ac20d5ec2da3.tar.bz2 ODR-AudioEnc-7862ca859932474649b0a933fac7ac20d5ec2da3.zip |
Use std::string for DAB channel mode
Diffstat (limited to 'src')
-rw-r--r-- | src/odr-audioenc.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index 7769481..6fde0a5 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -419,7 +419,7 @@ int main(int argc, char *argv[]) AACENC_InfoStruct info = { 0 }; int aot = AOT_NONE; - char dab_channel_mode = '\0'; + std::string dab_channel_mode; int dab_psy_model = 1; std::deque<uint8_t> toolame_output_buffer; @@ -515,7 +515,15 @@ int main(int argc, char *argv[]) break; case 3: // FIFO SILENCE case 4: // DAB channel mode - dab_channel_mode = optarg[0]; + dab_channel_mode = optarg; + if (not( dab_channel_mode == "s" or + dab_channel_mode == "d" or + dab_channel_mode == "j" or + dab_channel_mode == "m")) { + fprintf(stderr, "Invalid DAB channel mode\n"); + usage(argv[0]); + return 1; + } break; case 5: // DAB psy model dab_psy_model = std::stoi(optarg); @@ -777,7 +785,7 @@ int main(int argc, char *argv[]) err = toolame_set_psy_model(dab_psy_model); } - if (dab_channel_mode == '\0') { + if (dab_channel_mode.empty()) { if (channels == 2) { dab_channel_mode = 'j'; // Default to joint-stereo } @@ -791,7 +799,7 @@ int main(int argc, char *argv[]) } if (err == 0) { - err = toolame_set_channel_mode(dab_channel_mode); + err = toolame_set_channel_mode(dab_channel_mode.c_str()[0]); } // setting the ScF-CRC len here depends on set sample rate/channel mode |