Ticket #3533: mythtranscode.diff
File mythtranscode.diff, 2.8 KB (added by , 17 years ago) |
---|
-
programs/mythtranscode/main.cpp
old new void usage(char *progname) 54 54 cerr << "\t--fifosync : Enforce fifo sync\n"; 55 55 cerr << "\t--buildindex or -b: Build a new keyframe index\n"; 56 56 cerr << "\t (use only if audio and video fifos are read independantly)\n"; 57 cerr << "\t--video filename : Build a new keyframe index for a video\n"; 58 cerr << "\t (non-recording file)\n"; 57 59 cerr << "\t--showprogress : Display status info to the stdout\n"; 58 60 cerr << "\t--verbose level or -v: Use '-v help' for level info\n"; 59 61 cerr << "\t--help or -h: Prints this help statement.\n"; … … int main(int argc, char *argv[]) 84 86 int found_chanid = 0; 85 87 int found_infile = 0; 86 88 int update_index = 1; 89 int isVideo = 0; 87 90 88 91 for (int argpos = 1; argpos < a.argc(); ++argpos) 89 92 { … … int main(int argc, char *argv[]) 137 140 return TRANSCODE_EXIT_INVALID_CMDLINE; 138 141 } 139 142 } 143 else if (!strcmp(a.argv()[argpos],"--video")) 144 { 145 if (a.argc() > argpos) 146 { 147 infile = a.argv()[argpos + 1]; 148 found_infile = 1; 149 isVideo = 1; 150 build_index = true; 151 mpeg2 = true; 152 ++argpos; 153 } 154 else 155 { 156 cerr << "Missing argument to --video option\n"; 157 usage(a.argv()[0]); 158 return TRANSCODE_EXIT_INVALID_CMDLINE; 159 } 160 } 140 161 else if (!strcmp(a.argv()[argpos],"-o") || 141 162 !strcmp(a.argv()[argpos],"--outfile")) 142 163 { … … int main(int argc, char *argv[]) 362 383 } 363 384 if (jobID >= 0 && (found_infile || build_index)) 364 385 { 365 cerr << "Can't specify -j with --buildindex or --infile\n";386 cerr << "Can't specify -j with --buildindex, --video or --infile\n"; 366 387 return TRANSCODE_EXIT_INVALID_CMDLINE; 367 388 } 368 389 if ((jobID >= 0) && build_index) … … int main(int argc, char *argv[]) 403 424 404 425 infile = pginfo->GetPlaybackURL(false, true); 405 426 } 406 else 427 else if (!isVideo) 407 428 { 408 429 QFileInfo inf(infile); 409 430 pginfo = ProgramInfo::GetProgramFromBasename(inf.fileName()); … … int main(int argc, char *argv[]) 438 459 } 439 460 } 440 461 462 if (isVideo) 463 { 464 pginfo = new ProgramInfo; 465 pginfo->isVideo = 1; 466 pginfo->pathname = infile; 467 } 468 441 469 if (infile.left(7) == "myth://") { 442 470 VERBOSE(VB_IMPORTANT, QString("Attempted to transcode %1. " 443 471 "Mythtranscode is currently unable to transcode remote "