Ticket #7986: t7986_mythtranscode_buildindex_cleanup.diff

File t7986_mythtranscode_buildindex_cleanup.diff, 2.9 KB (added by taylor.ralph@…, 11 years ago)

cleanup mythtranscode --buildindex option

  • programs/mythtranscode/mpeg2fix.cpp

     
    746746        return 0;
    747747    }
    748748
     749    mkvfile = !strcmp(inputFC->iformat->name, "mkv") ? 1 : 0;
     750
    749751    if (offset)
    750752        av_seek_frame(inputFC, vid_id, offset, AVSEEK_FLAG_BYTE);
    751753
     
    25762578    if (!InitAV(fname.constData(), NULL, 0))
    25772579        return TRANSCODE_EXIT_UNKNOWN_ERROR;
    25782580
     2581    if (mkvfile)
     2582    {
     2583        VERBOSE(MPF_IMPORTANT, "Seek tables are not required for MKV");
     2584        return TRANSCODE_EXIT_UNKNOWN_ERROR;
     2585    }
     2586
    25792587    av_init_packet(&pkt);
    25802588
    25812589    while (av_read_frame(inputFC, &pkt) >= 0)
  • programs/mythtranscode/main.cpp

     
    568568        return TRANSCODE_EXIT_REMOTE_FILE;
    569569    }
    570570
    571     if (outfile.isNull())
     571    if (outfile.isNull() && !build_index)
    572572        outfile = infile + ".tmp";
    573573
    574574    if (jobID >= 0)
     
    576576
    577577    Transcode *transcode = new Transcode(pginfo);
    578578
    579     VERBOSE(VB_GENERAL, QString("Transcoding from %1 to %2")
    580                         .arg(infile).arg(outfile));
     579    if (!build_index)
     580        VERBOSE(VB_GENERAL, QString("Transcoding from %1 to %2")
     581                            .arg(infile).arg(outfile));
    581582
    582583    if (showprogress)
    583584        transcode->ShowProgress(true);
    584585    if (!recorderOptions.isEmpty())
    585586        transcode->SetRecorderOptions(recorderOptions);
    586587    int result = 0;
    587     if (!mpeg2)
     588    if (!mpeg2 && !build_index)
    588589    {
    589590        result = transcode->TranscodeFile(infile, outfile,
    590591                                          profilename, useCutlist,
     
    595596    }
    596597
    597598    int exitcode = TRANSCODE_EXIT_OK;
    598     if ((result == REENCODE_MPEG2TRANS) || mpeg2)
     599    if ((result == REENCODE_MPEG2TRANS) || mpeg2 || build_index)
    599600    {
    600601        void (*update_func)(float) = NULL;
    601602        int (*check_func)() = NULL;
     
    647648    {
    648649        if (jobID >= 0)
    649650            JobQueue::ChangeJobStatus(jobID, JOB_STOPPING);
    650         VERBOSE(VB_GENERAL, QString("Transcoding %1 done").arg(infile));
     651        VERBOSE(VB_GENERAL, QString("%1 %2 done")
     652                .arg(build_index ? "Building Index for" : "Transcoding")
     653                .arg(infile));
    651654    }
    652655    else if (result == REENCODE_CUTLIST_CHANGE)
    653656    {
  • programs/mythtranscode/mpeg2fix.h

     
    244244    int aud_stream_count;
    245245    int64_t ptsIncrement;
    246246    int64_t ptsOffset;  //was initPTS
     247    bool mkvfile;
    247248
    248249    int discard;
    249250    //control options