Skip to content

Commit

Permalink
VideoPlayer: drop useless interface ISeekable
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta authored and popcornmix committed Feb 20, 2016
1 parent 98c26f9 commit ed0bce2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 28 deletions.
10 changes: 2 additions & 8 deletions xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
Expand Up @@ -112,14 +112,6 @@ class CDVDInputStream
virtual bool SetState(const std::string &xmlstate) = 0;
};

class ISeekable
{
public:
virtual ~ISeekable() {};
virtual bool CanSeek() = 0;
virtual bool CanPause() = 0;
};

class IDemux
{
public:
Expand Down Expand Up @@ -155,6 +147,8 @@ class CDVDInputStream
virtual void Abort() {}
virtual int GetBlockSize() { return 0; }
virtual void ResetScanTimeout(unsigned int iTimeoutMs) { }
virtual bool CanSeek() { return true; }
virtual bool CanPause() { return true; }

/*! \brief Indicate expected read rate in bytes per second.
* This could be used to throttle caching rate. Should
Expand Down
9 changes: 4 additions & 5 deletions xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpeg.h
Expand Up @@ -24,7 +24,6 @@

class CDVDInputStreamFFmpeg
: public CDVDInputStream
, public CDVDInputStream::ISeekable
{
public:
CDVDInputStreamFFmpeg(CFileItem& fileitem);
Expand All @@ -37,11 +36,11 @@ class CDVDInputStreamFFmpeg
virtual bool IsEOF();
virtual int64_t GetLength();

virtual void Abort() { m_aborted = true; }
bool Aborted() { return m_aborted; }
virtual void Abort() { m_aborted = true; }
bool Aborted() { return m_aborted; }

bool CanSeek() { return m_can_seek; }
bool CanPause() { return m_can_pause; }
bool CanSeek() { return m_can_seek; }
bool CanPause() { return m_can_pause; }

protected:
bool m_can_pause;
Expand Down
Expand Up @@ -46,7 +46,6 @@ class IDemux;
class CDVDInputStreamPVRManager
: public CDVDInputStream
, public CDVDInputStream::IDisplayTime
, public CDVDInputStream::ISeekable
, public CDVDInputStream::IDemux
{
public:
Expand Down
17 changes: 8 additions & 9 deletions xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h
Expand Up @@ -27,20 +27,19 @@
class CDVDInputStreamRTMP
: public CDVDInputStream
, public CDVDInputStream::ISeekTime
, public CDVDInputStream::ISeekable
{
public:
CDVDInputStreamRTMP(CFileItem &fileitem);
virtual ~CDVDInputStreamRTMP();
virtual bool Open();
virtual void Close();
virtual int Read(uint8_t* buf, int buf_size);
virtual bool Open();
virtual void Close();
virtual int Read(uint8_t* buf, int buf_size);
virtual int64_t Seek(int64_t offset, int whence);
bool SeekTime(int iTimeInMsec);
bool CanSeek() { return m_canSeek; }
bool CanPause() { return m_canPause; }
virtual bool Pause(double dTime);
virtual bool IsEOF();
bool SeekTime(int iTimeInMsec);
bool CanSeek() { return m_canSeek; }
bool CanPause() { return m_canPause; }
virtual bool Pause(double dTime);
virtual bool IsEOF();
virtual int64_t GetLength();

CCriticalSection m_RTMPSection;
Expand Down
7 changes: 2 additions & 5 deletions xbmc/cores/VideoPlayer/VideoPlayer.cpp
Expand Up @@ -4760,11 +4760,8 @@ void CVideoPlayer::UpdatePlayState(double timeout)
state.hasMenu = true;
}

if (CDVDInputStream::ISeekable* ptr = dynamic_cast<CDVDInputStream::ISeekable*>(m_pInputStream))
{
state.canpause = ptr->CanPause();
state.canseek = ptr->CanSeek();
}
state.canpause = m_pInputStream->CanPause();
state.canseek = m_pInputStream->CanSeek();
}

if (m_Edl.HasCut())
Expand Down

0 comments on commit ed0bce2

Please sign in to comment.