Ticket #1093: mythtranscode-dvd.patch
File mythtranscode-dvd.patch, 5.2 KB (added by , 18 years ago) |
---|
-
mpeg2fix.cpp
196 196 MPEG2fixup::MPEG2fixup(const char *inf, const char *outf, 197 197 QMap<long long, int> *deleteMap, 198 198 const char *fmt, int norp, int fixPTS, int maxf, 199 bool showprog )199 bool showprog, int otype) 200 200 { 201 201 displayFrame = new QPtrListIterator<MPEG2frame> (vFrame); 202 202 … … 207 207 no_repeat = norp; 208 208 fix_PTS = fixPTS; 209 209 maxframes = maxf; 210 rx.otype = otype; 210 211 211 212 real_file_end = file_end = false; 212 213 … … 506 507 int video_delay = 0, audio_delay = 0; 507 508 int fd_out; 508 509 509 int otype = REPLEX_MPEG2;510 511 510 memset(&mx, 0, sizeof(mx)); 512 511 memset(ext_ok, 0, sizeof(ext_ok)); 513 512 … … 2256 2255 fprintf(stderr, "\t--cutlist \"start - end\" -c : Apply a cutlist. Specify on e'-c' per cut\n"); 2257 2256 fprintf(stderr, "\t--no3to2 -t : Remove 3:2 pullup\n"); 2258 2257 fprintf(stderr, "\t--fixup -f : make PTS contiuous\n"); 2258 fprintf(stderr, "\t--dvd -n : Insert DVD NAV packets\n"); 2259 2259 fprintf(stderr, "\t--showprogress -p : show progress\n"); 2260 2260 fprintf(stderr, "\t--help -h : This screen\n"); 2261 2261 exit(0); … … 2266 2266 QStringList cutlist; 2267 2267 QStringList savelist; 2268 2268 char *infile = NULL, *outfile = NULL, *format = NULL; 2269 int no_repeat = 0, fix_PTS = 0, max_frames = 20 ;2269 int no_repeat = 0, fix_PTS = 0, max_frames = 20, otype = REPLEX_MPEG2; 2270 2270 bool showprogress = 0; 2271 2271 const struct option long_options[] = 2272 2272 { … … 2279 2279 {"saveframe", required_argument, NULL, 's'}, 2280 2280 {"no3to2", no_argument, NULL, 't'}, 2281 2281 {"fixup", no_argument, NULL, 'f'}, 2282 {"dvd", no_argument, NULL, 'n'}, 2282 2283 {"showprogress", no_argument, NULL, 'p'}, 2283 2284 {"help", no_argument , NULL, 'h'}, 2284 2285 {0, 0, 0, 0} … … 2288 2289 { 2289 2290 int option_index = 0; 2290 2291 char c; 2291 c = getopt_long (argc, argv, "i:o:d:r:m:c:s:tf ph",2292 c = getopt_long (argc, argv, "i:o:d:r:m:c:s:tfnph", 2292 2293 long_options, &option_index); 2293 2294 2294 2295 if (c == -1) … … 2327 2328 case 'f': 2328 2329 fix_PTS = 1; 2329 2330 break; 2331 2332 case 'n': 2333 otype = REPLEX_DVD; 2334 break; 2335 2330 2336 case 's': 2331 2337 savelist.append(optarg); 2332 2338 break; … … 2349 2355 2350 2356 MPEG2fixup m2f(infile, outfile, NULL, format, 2351 2357 no_repeat, fix_PTS, max_frames, 2352 showprogress );2358 showprogress, otype); 2353 2359 2354 2360 if (cutlist.count()) 2355 2361 m2f.AddRangeList(cutlist, MPF_TYPE_CUTLIST); -
main.cpp
33 33 cerr << "\t<--starttime <starttime>> <--profile <profile>>\n"; 34 34 cerr << "\t[options]\n\n"; 35 35 cerr << "\t--mpeg2 or -m: Perform MPEG2 to MPEG2 transcode.\n"; 36 cerr << "\t--dvd or -n: Insert DVD NAV packets.\n"; 36 37 cerr << "\t--chanid or -c: Takes a channel id. REQUIRED\n"; 37 38 cerr << "\t--starttime or -s: Takes a starttime for the\n"; 38 39 cerr << "\t recording. REQUIRED\n"; … … 60 61 QString profilename = QString("autodetect"); 61 62 QString fifodir = NULL; 62 63 int jobID = -1; 64 int otype = REPLEX_MPEG2; 63 65 bool useCutlist = false, keyframesonly = false; 64 66 bool build_index = false, fifosync = false, showprogress = false, mpeg2 = false; 65 67 QMap<long long, int> deleteMap; … … 272 274 { 273 275 mpeg2 = true; 274 276 } 277 else if (!strcmp(a.argv()[argpos],"-n") || 278 !strcmp(a.argv()[argpos],"--dvd")) 279 { 280 otype = REPLEX_DVD; 281 } 275 282 else if (!strcmp(a.argv()[argpos],"-h") || 276 283 !strcmp(a.argv()[argpos],"--help")) 277 284 { … … 401 408 402 409 MPEG2fixup *m2f = new MPEG2fixup(infile.ascii(), outfile.ascii(), 403 410 &deleteMap, NULL, false, false, 20, 404 showprogress );411 showprogress, otype); 405 412 if (build_index) 406 413 { 407 414 int err = BuildKeyframeIndex(m2f, infile, posMap, jobID); -
mpeg2fix.h
107 107 int WaitBuffers(); 108 108 int done; 109 109 QString outfile; 110 int otype; 110 111 ringbuffer vrbuf; 111 112 ringbuffer extrbuf[N_AUDIO]; 112 113 ringbuffer index_vrbuf; … … 129 130 public: 130 131 MPEG2fixup(const char *inf, const char *outf, 131 132 QMap<long long, int> *deleteMap, const char *fmt, int norp, 132 int fixPTS, int maxf, bool showprog );133 int fixPTS, int maxf, bool showprog, int otype); 133 134 ~MPEG2fixup(); 134 135 int Start(); 135 136 void AddRangeList(QStringList cutlist, int type);