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;
}