--- a/mpd2src/mpd2sc.cpp
+++ b/mpd2src/mpd2sc.cpp
@@ -466,8 +466,9 @@
static char *thisprog;
static char usage [] =
" -h, --help, show this help message and exit.\n"
-" -A, --audio, [44100:16:2:0/1] audio params only if they can't be obtained\n"
-" from the file. Conflicting values will cause error."
+" -A, --audio, [44100:16:2:0/1] freq:bits:chans:swap.\n"
+" swap==1 if the input is little-endian. Set this only if the data can't be\n"
+" obtained from the file. Conflicting values will cause an error. \n"
" -a, --adapter, [adapter] index of network adapter to use.\n"
" -c, --channel, [0..65535] sender channel.\n"
" -d, --disabled, [disabled] start up disabled.\n"
@@ -522,10 +523,10 @@
thisprog = argv[0];
int ret;
(void)op_flags;
- string audioparams, sfile, sname("Openhome WavSender"), sudn("12345678");
- unsigned int adaptidx(0), channel(0), ttl(1), latency(100);
+ string audioparams, sfile, sname("Openhome WavSender"), sudn("12345678");
+ unsigned int adaptidx(0), channel(0), ttl(1), latency(100);
while ((ret = getopt_long(argc, argv, "A:a:c:df:l:mn:pt:u:",
- long_options, NULL)) != -1) {
+ long_options, NULL)) != -1) {
switch (ret) {
case 'A': audioparams = optarg;op_flags |= OPT_A; break;
case 'a': adaptidx = atoi(optarg);op_flags |= OPT_a; break;
@@ -545,7 +546,9 @@
}
if (optind != argc )
Usage();
-
+ if (sfile.empty())
+ Usage();
+
InitialisationParams* initParams = InitialisationParams::Create();
Library* lib = new Library(initParams);
@@ -571,10 +574,6 @@
LOGDEB("using subnet " << (subnet&0xff) << "." << ((subnet>>8)&0xff) << "."
<< ((subnet>>16)&0xff) << "." << ((subnet>>24)&0xff) << endl);
- if (sfile.empty()) {
- LOGERR("No input file specified\n");
- return (1);
- }
Brhz file(sfile.c_str());
Brhz udn(sudn.c_str());