Ticket #1093: mythtranscode-dvd.patch

File mythtranscode-dvd.patch, 5.2 KB (added by bolek-mythtv@…, 20 years ago)
  • mpeg2fix.cpp

     
    196196MPEG2fixup::MPEG2fixup(const char *inf, const char *outf,
    197197                       QMap<long long, int> *deleteMap,
    198198                       const char *fmt, int norp, int fixPTS, int maxf,
    199                        bool showprog)
     199                       bool showprog, int otype)
    200200{
    201201    displayFrame = new QPtrListIterator<MPEG2frame> (vFrame);
    202202
     
    207207    no_repeat = norp;
    208208    fix_PTS = fixPTS;
    209209    maxframes = maxf;
     210    rx.otype = otype;
    210211
    211212    real_file_end = file_end = false;
    212213
     
    506507    int video_delay = 0, audio_delay = 0;
    507508    int fd_out;
    508509
    509     int otype = REPLEX_MPEG2;
    510 
    511510    memset(&mx, 0, sizeof(mx));
    512511    memset(ext_ok, 0, sizeof(ext_ok));
    513512
     
    22562255    fprintf(stderr, "\t--cutlist \"start - end\" -c : Apply a cutlist.  Specify on e'-c' per cut\n");
    22572256    fprintf(stderr, "\t--no3to2           -t        : Remove 3:2 pullup\n");
    22582257    fprintf(stderr, "\t--fixup            -f        : make PTS contiuous\n");
     2258    fprintf(stderr, "\t--dvd              -n        : Insert DVD NAV packets\n");
    22592259    fprintf(stderr, "\t--showprogress     -p        : show progress\n");
    22602260    fprintf(stderr, "\t--help             -h        : This screen\n");
    22612261    exit(0);
     
    22662266    QStringList cutlist;
    22672267    QStringList savelist;
    22682268    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;
    22702270    bool showprogress = 0;
    22712271    const struct option long_options[] =
    22722272        {
     
    22792279            {"saveframe", required_argument, NULL, 's'},
    22802280            {"no3to2", no_argument, NULL, 't'},
    22812281            {"fixup", no_argument, NULL, 'f'},
     2282            {"dvd", no_argument, NULL, 'n'},
    22822283            {"showprogress", no_argument, NULL, 'p'},
    22832284            {"help", no_argument , NULL, 'h'},
    22842285            {0, 0, 0, 0}
     
    22882289    {
    22892290        int option_index = 0;
    22902291        char c;
    2291         c = getopt_long (argc, argv, "i:o:d:r:m:c:s:tfph",
     2292        c = getopt_long (argc, argv, "i:o:d:r:m:c:s:tfnph",
    22922293                         long_options, &option_index);
    22932294
    22942295        if (c == -1)
     
    23272328            case 'f':
    23282329                fix_PTS = 1;
    23292330                break;
     2331
     2332            case 'n':
     2333                otype = REPLEX_DVD;
     2334                break;
     2335
    23302336            case 's':
    23312337                savelist.append(optarg);
    23322338                break;
     
    23492355
    23502356    MPEG2fixup m2f(infile, outfile, NULL, format,
    23512357                   no_repeat, fix_PTS, max_frames,
    2352                    showprogress);
     2358                   showprogress, otype);
    23532359
    23542360    if (cutlist.count())
    23552361        m2f.AddRangeList(cutlist, MPF_TYPE_CUTLIST);
  • main.cpp

     
    3333    cerr << "\t<--starttime <starttime>> <--profile <profile>>\n";
    3434    cerr << "\t[options]\n\n";
    3535    cerr << "\t--mpeg2          or -m: Perform MPEG2 to MPEG2 transcode.\n";
     36    cerr << "\t--dvd            or -n: Insert DVD NAV packets.\n";
    3637    cerr << "\t--chanid         or -c: Takes a channel id. REQUIRED\n";
    3738    cerr << "\t--starttime      or -s: Takes a starttime for the\n";
    3839    cerr << "\t                        recording. REQUIRED\n";
     
    6061    QString profilename = QString("autodetect");
    6162    QString fifodir = NULL;
    6263    int jobID = -1;
     64    int otype = REPLEX_MPEG2;
    6365    bool useCutlist = false, keyframesonly = false;
    6466    bool build_index = false, fifosync = false, showprogress = false, mpeg2 = false;
    6567    QMap<long long, int> deleteMap;
     
    272274        {
    273275            mpeg2 = true;
    274276        }
     277        else if (!strcmp(a.argv()[argpos],"-n") ||
     278                 !strcmp(a.argv()[argpos],"--dvd"))
     279        {
     280            otype = REPLEX_DVD;
     281        }
    275282        else if (!strcmp(a.argv()[argpos],"-h") ||
    276283                 !strcmp(a.argv()[argpos],"--help"))
    277284        {
     
    401408       
    402409        MPEG2fixup *m2f = new MPEG2fixup(infile.ascii(), outfile.ascii(),
    403410                                         &deleteMap, NULL, false, false, 20,
    404                                          showprogress);
     411                                         showprogress, otype);
    405412        if (build_index)
    406413        {
    407414            int err = BuildKeyframeIndex(m2f, infile, posMap, jobID);
  • mpeg2fix.h

     
    107107    int WaitBuffers();
    108108    int done;
    109109    QString outfile;
     110    int otype;
    110111    ringbuffer vrbuf;
    111112    ringbuffer extrbuf[N_AUDIO];
    112113    ringbuffer index_vrbuf;
     
    129130  public:
    130131    MPEG2fixup(const char *inf, const char *outf,
    131132               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);
    133134    ~MPEG2fixup();
    134135    int Start();
    135136    void AddRangeList(QStringList cutlist, int type);