diff -Naur ./orig//main.cpp ./patched//main.cpp
old
|
new
|
|
66 | 66 | cerr << "\t or -ro: Pass a comma-separated list of\n"; |
67 | 67 | cerr << "\t recordingprofile options to override\n"; |
68 | 68 | cerr << "\t values in the database.\n"; |
| 69 | cerr << "\t--audiotrack <trackno>: Selects the audiotrack for transcoding.\n"; |
69 | 70 | cerr << "\t--verbose level or -v: Use '-v help' for level info\n"; |
70 | 71 | cerr << "\t--help or -h: Prints this help statement.\n"; |
71 | 72 | } |
… |
… |
|
149 | 150 | frm_dir_map_t deleteMap; |
150 | 151 | frm_pos_map_t posMap; |
151 | 152 | srand(time(NULL)); |
| 153 | int AudioTrackNo = -1; |
152 | 154 | |
153 | 155 | QCoreApplication a(argc, argv); |
154 | 156 | |
… |
… |
|
474 | 476 | |
475 | 477 | ++argpos; |
476 | 478 | } |
| 479 | else if (!strcmp(a.argv()[argpos],"--audiotrack")) |
| 480 | { |
| 481 | if (a.argc()-1 > argpos && a.argv()[argpos+1][0] != '-') |
| 482 | { |
| 483 | AudioTrackNo = QString(a.argv()[argpos + 1]).toInt(); |
| 484 | } |
| 485 | else |
| 486 | { |
| 487 | cerr << "Invalid or missing argument to --audiotrack " |
| 488 | "option\n"; |
| 489 | usage(a.argv()[0]); |
| 490 | return TRANSCODE_EXIT_INVALID_CMDLINE; |
| 491 | } |
| 492 | |
| 493 | ++argpos; |
| 494 | } |
477 | 495 | else if (!strcmp(a.argv()[argpos],"-h") || |
478 | 496 | !strcmp(a.argv()[argpos],"--help")) |
479 | 497 | { |
… |
… |
|
639 | 657 | result = transcode->TranscodeFile(infile, outfile, |
640 | 658 | profilename, useCutlist, |
641 | 659 | (fifosync || keyframesonly), jobID, |
642 | | fifodir, deleteMap); |
| 660 | fifodir, deleteMap, AudioTrackNo); |
643 | 661 | if ((result == REENCODE_OK) && (jobID >= 0)) |
644 | 662 | JobQueue::ChangeJobArgs(jobID, "RENAME_TO_NUV"); |
645 | 663 | } |
diff -Naur ./orig//transcode.cpp ./patched//transcode.cpp
old
|
new
|
|
364 | 364 | const QString &profileName, |
365 | 365 | bool honorCutList, bool framecontrol, |
366 | 366 | int jobID, QString fifodir, |
367 | | frm_dir_map_t &deleteMap) |
| 367 | frm_dir_map_t &deleteMap, |
| 368 | int AudioTrackNo) |
368 | 369 | { |
369 | 370 | QDateTime curtime = QDateTime::currentDateTime(); |
370 | 371 | QDateTime statustime = curtime; |
… |
… |
|
712 | 713 | return REENCODE_ERROR; |
713 | 714 | } |
714 | 715 | |
| 716 | if (AudioTrackNo > -1) |
| 717 | { |
| 718 | VERBOSE(VB_GENERAL, QString("Set audiotrack number to %1").arg(AudioTrackNo)); |
| 719 | player->GetDecoder()->SetTrack(kTrackTypeAudio, AudioTrackNo); |
| 720 | } |
| 721 | |
715 | 722 | int vidSize = 0; |
716 | 723 | |
717 | 724 | // 1920x1080 video is actually 1920x1088 because of the 16x16 blocks so |
diff -Naur ./orig//transcode.h ./patched//transcode.h
old
|
new
|
|
20 | 20 | const QString &outputname, |
21 | 21 | const QString &profileName, |
22 | 22 | bool honorCutList, bool framecontrol, int jobID, |
23 | | QString fifodir, frm_dir_map_t &deleteMap); |
| 23 | QString fifodir, frm_dir_map_t &deleteMap, |
| 24 | int AudioTrackNo); |
24 | 25 | void ShowProgress(bool val) { showprogress = val; } |
25 | 26 | void SetRecorderOptions(QString options) { recorderOptions = options; } |
26 | 27 | |