diff options
author | jmarshallnz <jcmarsha@gmail.com> | 2014-05-02 08:01:14 +1200 |
---|---|---|
committer | jmarshallnz <jcmarsha@gmail.com> | 2014-05-02 08:01:14 +1200 |
commit | 3bab0a44aba14dc9c06cb7f3d16ce97f1d7178a9 (patch) | |
tree | 2a88e48f94a4ab511ed2131ef4629d67c4fe0ecc | |
parent | 088e9faba293e3708f926cccd37cc7f242769fe5 (diff) | |
parent | 39d7028e5b627e214c3430226eeb601bde66eea6 (diff) |
Merge pull request #4624 from FernetMenta/paplayer
paplayer: dvdplayercodec - check if seek is possible before trying to se...
-rw-r--r-- | xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/paplayer/DVDPlayerCodec.cpp | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp index 1b0f7e8460..122e92297c 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp @@ -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; } diff --git a/xbmc/cores/paplayer/DVDPlayerCodec.cpp b/xbmc/cores/paplayer/DVDPlayerCodec.cpp index 163c928a1e..1f7287b395 100644 --- a/xbmc/cores/paplayer/DVDPlayerCodec.cpp +++ b/xbmc/cores/paplayer/DVDPlayerCodec.cpp @@ -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 |