diff options
author | Matthias P. Braendli (think) <matthias@mpb.li> | 2013-11-08 14:43:19 +0100 |
---|---|---|
committer | Matthias P. Braendli (think) <matthias@mpb.li> | 2013-11-08 14:43:19 +0100 |
commit | c5306f81a9d3b87df7e16c852f2505ac913193ca (patch) | |
tree | 40716835305aa871cae5a5b3c805f0c673f47108 /src/ParserCmdline.cpp | |
parent | 573c7b63092618ecae86847d9d0a143801db0780 (diff) | |
download | dabmux-c5306f81a9d3b87df7e16c852f2505ac913193ca.tar.gz dabmux-c5306f81a9d3b87df7e16c852f2505ac913193ca.tar.bz2 dabmux-c5306f81a9d3b87df7e16c852f2505ac913193ca.zip |
make dabOutput more object-oriented
Diffstat (limited to 'src/ParserCmdline.cpp')
-rw-r--r-- | src/ParserCmdline.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/ParserCmdline.cpp b/src/ParserCmdline.cpp index 7fb2632..33896b6 100644 --- a/src/ParserCmdline.cpp +++ b/src/ParserCmdline.cpp @@ -34,7 +34,7 @@ #include <vector> #include <stdint.h> #include <cstring> -#include "dabOutput.h" +#include "dabOutput/dabOutput.h" #include "dabInput.h" #include "utils.h" #include "dabInputFile.h" @@ -124,15 +124,6 @@ bool parse_cmdline(char **argv, } switch (c) { case 'O': - outputs.push_back(new dabOutput); - output = outputs.end() - 1; - - memset(*output, 0, sizeof(dabOutput)); - (*output)->outputProto = NULL; - (*output)->outputName = NULL; - (*output)->data = NULL; - (*output)->operations = dabOutputDefaultOperations; - char* proto; proto = strstr(optarg, "://"); @@ -141,10 +132,11 @@ bool parse_cmdline(char **argv, "No protocol defined for output\n"); goto EXIT; } else { - (*output)->outputProto = optarg; - (*output)->outputName = proto + 3; - *proto = 0; + *proto = 0; // terminate optarg + outputs.push_back(new dabOutput(optarg, proto + 3)); + output = outputs.end() - 1; } + subchannel = ensemble->subchannels.end(); protection = NULL; component = ensemble->components.end(); @@ -803,15 +795,9 @@ bool parse_cmdline(char **argv, case 'r': etiLog.printHeader(TcpLog::INFO, "Enabling throttled output using simul, one frame every 24ms\n"); - outputs.push_back(new dabOutput); + outputs.push_back(new dabOutput("simul", NULL)); output = outputs.end() - 1; - memset(*output, 0, sizeof(dabOutput)); - (*output)->outputProto = "simul"; - (*output)->outputName = ""; - (*output)->data = NULL; - (*output)->operations = dabOutputDefaultOperations; - subchannel = ensemble->subchannels.end(); protection = NULL; component = ensemble->components.end(); |