ref: f427fc63df3f5dc84e10cd2686af3293812b677c
parent: e307cbb6a1c426e2dbb23054d02d6ebdaaa559c7
parent: e65525d7b45f0b7ad07dd45b8259baedf3314160
author: Ethan Hugg <ethanhugg@gmail.com>
date: Sun Dec 15 15:24:18 EST 2013
Merge pull request #53 from varunbpatil/cleanup Improve handling of help switch in enc test app
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -451,11 +451,11 @@
void PrintHelp() { printf ("\n Wels SVC Encoder Usage:\n\n");+ printf (" Syntax: welsenc.exe -h\n"); printf (" Syntax: welsenc.exe welsenc.cfg\n"); printf (" Syntax: welsenc.exe welsenc.cfg [options]\n"); printf ("\n Supported Options:\n");- printf (" -h Print Help\n"); printf (" -bf Bit Stream File\n"); printf (" -frms Number of total frames to be encoded\n"); printf (" -gop GOPSize - GOP size (2,4,8,16,32,64, default: 1)\n");@@ -497,10 +497,6 @@
while (n < argc) {pCommand = argv[n++];
- if (!strcmp (pCommand, "-h")) { // confirmed_safe_unsafe_usage- PrintHelp();
- continue;
- }
if (!strcmp (pCommand, "-bf")) { // confirmed_safe_unsafe_usagesFileSet.strBsFile.assign (argv[n]);
++ n;
@@ -1420,14 +1416,15 @@
} else {string strCfgFileName = argv[1];
basic_string <char>::size_type index;
- static const basic_string <char>::size_type npos = size_t (-1);
index = strCfgFileName.rfind (".cfg"); // check configuration type (like .cfg?)- if (index == npos) {+ if (index == std::string::npos) { if (argc > 2) {iRet = ProcessEncodingSvcWithParam (pSVCEncoder, argc, argv);
if (iRet != 0)
goto exit;
- } else {+ } else if (argc == 2 && ! strcmp(argv[1], "-h"))
+ PrintHelp();
+ else {cout << "You specified pCommand is invalid!!" << endl;
goto exit;
}
--
⑨