All pastes #895222 Raw Edit

Something

public text v1 · immutable
#895222 ·published 2008-02-07 17:36 UTC
rendered paste body
uint NuppelVideoPlayer::GetDVDLength()
{
    using_null_videoout = true;

    if (OpenFile(false, 0, false) < 0)
    {
        VERBOSE(VB_IMPORTANT, LOC_ERR + "Could not open file for DVD length "
                                        "query.");
        return NULL;
    }

    if (!InitVideo())
    {
        VERBOSE(VB_IMPORTANT, LOC_ERR +
                "Unable to initialize video for screen grab.");
        return NULL;
    }

    ClearAfterSeek();

    if (!ringBuffer->isDVD())
        return 0;

    // Get length of the DVD
    ringBuffer->DVD()->PlayTitleAndPart(1, 1);
    ringBuffer->DVD()->JumpToTitle(true);

    DoFastForward();
    fftime = 0;

    uint time = ringBuffer->DVD()->GetTotalTimeOfTitle();
    cerr << "DVD Length: " << time << endl;

    return time;
}