Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dvdplayer: for protocols managed by ffmpeg, ask if we can seek

  • Loading branch information...
commit 4f960e65a222cb15a634363f1adfbc5476f140e8 1 parent 4cad623
Cory Fields authored
View
14 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
@@ -833,8 +833,7 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts)
return true;
}
- if(!m_pInput->Seek(0, SEEK_POSSIBLE)
- && !m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG))
+ if (!CanSeek())
{
CLog::Log(LOGDEBUG, "%s - input stream reports it is not seekable", __FUNCTION__);
return false;
@@ -1327,3 +1326,14 @@ void CDVDDemuxFFmpeg::GetStreamCodecName(int iStreamId, CStdString &strName)
strName = codec->name;
}
}
+
+bool CDVDDemuxFFmpeg::CanSeek()
+{
+ if((m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG) &&
+ ((m_pFormatContext->pb && m_pFormatContext->pb->seekable == 0 ) &&
+ m_pFormatContext->pb->seekable == 0 ) ||
@theuni Owner
theuni added a note

heh, ignore the busted c/p.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ !m_pInput->Seek(0, SEEK_POSSIBLE)))
+ return false;
+
+ return true;
+}
View
1  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h
@@ -103,6 +103,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux
int GetNrOfStreams();
bool SeekChapter(int chapter, double* startpts = NULL);
+ bool CanSeek();
int GetChapterCount();
int GetChapter();
void GetChapterName(std::string& strChapterName);
View
6 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -28,6 +28,7 @@
#include "DVDInputStreams/DVDInputStreamNavigator.h"
#include "DVDInputStreams/DVDInputStreamTV.h"
#include "DVDInputStreams/DVDInputStreamPVRManager.h"
+#include "DVDInputStreams/DVDInputStreamFFmpeg.h"
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
@@ -3946,6 +3947,11 @@ void CDVDPlayer::UpdatePlayState(double timeout)
state.canpause = pvrinputstream->CanPause();
state.canseek = pvrinputstream->CanSeek();
}
+ else if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_FFMPEG) && m_pDemuxer)
+ {
+ CDVDDemuxFFmpeg* dvddemuxffmpeg = static_cast<CDVDDemuxFFmpeg*>(m_pDemuxer);
+ state.canseek = dvddemuxffmpeg->CanSeek();
@theuni Owner
theuni added a note

Needs to be added to CDVDDemux instead of grabbing it this way, as @elupus said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ }
else
{
state.canseek = state.time_total > 0 ? true : false;
@theuni

heh, ignore the busted c/p.

@theuni

Needs to be added to CDVDDemux instead of grabbing it this way, as @elupus said.

Please sign in to comment.
Something went wrong with that request. Please try again.