From: jmarshallnz Date: Thu, 1 May 2014 20:01:14 +0000 (+1200) Subject: Merge pull request #4624 from FernetMenta/paplayer X-Git-Tag: 13.0-Gotham~13 X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_xbmc;a=commitdiff_plain;h=fc2b1b2c1ad0d235b91a33e430d39bd63de71f58 Merge pull request #4624 from FernetMenta/paplayer paplayer: dvdplayercodec - check if seek is possible before trying to se... --- diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp index 1b0f7e8..122e922 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 c60abc8..411d6bf 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