Skip to content

Commit

Permalink
Merge pull request #4624 from FernetMenta/paplayer
Browse files Browse the repository at this point in the history
paplayer: dvdplayercodec - check if seek is possible before trying to se...
  • Loading branch information
jmarshallnz committed May 1, 2014
2 parents 088e9fa + 39d7028 commit 3bab0a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Expand Up @@ -91,7 +91,7 @@ bool CDVDInputStreamFile::Open(const char* strFile, const std::string& content)
if (m_pFile->GetImplemenation() && (content.empty() || content == "application/octet-stream"))
m_content = m_pFile->GetImplemenation()->GetContent();

m_eof = false;
m_eof = true;
return true;
}

Expand Down
22 changes: 13 additions & 9 deletions xbmc/cores/paplayer/DVDPlayerCodec.cpp
Expand Up @@ -194,17 +194,21 @@ bool DVDPlayerCodec::Init(const CStdString &strFile, unsigned int filecache)
}

// test if seeking is supported
if (Seek(1) != DVD_NOPTS_VALUE)
{
// rewind stream to beginning
Seek(0);
m_bCanSeek = true;
}
else
m_bCanSeek = false;
if (m_pInputStream->Seek(0, SEEK_POSSIBLE))
{
// reset eof flag of stream, with eof set seek returns always success
m_pInputStream->Seek(0, SEEK_SET);
m_pDemuxer->Reset();
m_bCanSeek = false;
if (Seek(1) != DVD_NOPTS_VALUE)
{
// rewind stream to beginning
Seek(0);
}
else
{
m_pInputStream->Seek(0, SEEK_SET);
m_pDemuxer->Reset();
}
}

if (m_Channels == 0) // no data - just guess and hope for the best
Expand Down

0 comments on commit 3bab0a4

Please sign in to comment.