Add a -v option to ffmsindex.

Originally committed to SVN as r2775.
This commit is contained in:
Karl Blomster 2009-04-07 01:12:12 +00:00
parent 2960b0298c
commit e00fae15d6

View file

@ -28,6 +28,7 @@ int TrackMask;
int DumpMask; int DumpMask;
bool Overwrite; bool Overwrite;
bool IgnoreErrors; bool IgnoreErrors;
bool Verbose;
std::string InputFile; std::string InputFile;
std::string CacheFile; std::string CacheFile;
std::string AudioFile; std::string AudioFile;
@ -43,6 +44,7 @@ void PrintUsage () {
<< "Options:" << endl << "Options:" << endl
<< "-f Force overwriting of existing index file, if any (default: no)" << endl << "-f Force overwriting of existing index file, if any (default: no)" << endl
<< "-s Silently skip indexing of audio tracks that cannot be read (default: no)" << endl << "-s Silently skip indexing of audio tracks that cannot be read (default: no)" << endl
<< "-v Be verbose; i.e. print FFmpeg warnings/diagnostics, if any (default: no)" << endl
<< "-t N Set the audio indexing mask to N (-1 means index all tracks, 0 means index none, default: 0)" << endl << "-t N Set the audio indexing mask to N (-1 means index all tracks, 0 means index none, default: 0)" << endl
<< "-d N Set the audio decoding mask to N (mask syntax same as -t, default: 0)" << endl << "-d N Set the audio decoding mask to N (mask syntax same as -t, default: 0)" << endl
<< "-a NAME Set the audio output base filename to NAME (default: input filename)"; << "-a NAME Set the audio output base filename to NAME (default: input filename)";
@ -63,6 +65,7 @@ void ParseCMDLine (int argc, char *argv[]) {
DumpMask = 0; DumpMask = 0;
Overwrite = false; Overwrite = false;
IgnoreErrors = false; IgnoreErrors = false;
Verbose = false;
// argv[0] = name of program // argv[0] = name of program
int i = 1; int i = 1;
@ -77,6 +80,8 @@ void ParseCMDLine (int argc, char *argv[]) {
Overwrite = true; Overwrite = true;
} else if (!Option.compare("-s")) { } else if (!Option.compare("-s")) {
IgnoreErrors = true; IgnoreErrors = true;
} else if (!Option.compare("-v")) {
Verbose = true;
} else if (!Option.compare("-t")) { } else if (!Option.compare("-t")) {
TrackMask = atoi(OptionArg.c_str()); TrackMask = atoi(OptionArg.c_str());
i++; i++;
@ -180,6 +185,9 @@ int main(int argc, char *argv[]) {
FFMS_Init(); FFMS_Init();
if (!Verbose)
FFMS_NoLog();
try { try {
DoIndexing(); DoIndexing();
} catch (const char *Error) { } catch (const char *Error) {