paplayer: dvdplayercodec - check if seek is possible before trying to se...
if (m_pFile->GetImplemenation() && (content.empty() || content == "application/octet-stream"))
m_content = m_pFile->GetImplemenation()->GetContent();
if (m_pFile->GetImplemenation() && (content.empty() || content == "application/octet-stream"))
m_content = m_pFile->GetImplemenation()->GetContent();
}
// test if seeking is supported
}
// 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_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
}
if (m_Channels == 0) // no data - just guess and hope for the best