Skip to content

Commit

Permalink
Merge pull request #4594 from FernetMenta/paplayer
Browse files Browse the repository at this point in the history
paplayer: proper handling of non seekable streams
  • Loading branch information
jmarshallnz authored and Jonathan Marshall committed Apr 27, 2014
1 parent ebb8737 commit 246d786
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Expand Up @@ -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 = true;
m_eof = false;
return true;
}

Expand Down
22 changes: 18 additions & 4 deletions xbmc/cores/paplayer/DVDPlayerCodec.cpp
Expand Up @@ -193,8 +193,19 @@ bool DVDPlayerCodec::Init(const CStdString &strFile, unsigned int filecache)
return false;
}

// rewind stream to beginning
Seek(0);
// test if seeking is supported
if (Seek(1) != DVD_NOPTS_VALUE)
{
// rewind stream to beginning
Seek(0);
m_bCanSeek = true;
}
else
{
m_pInputStream->Seek(0, SEEK_SET);
m_pDemuxer->Reset();
m_bCanSeek = false;
}

if (m_Channels == 0) // no data - just guess and hope for the best
m_Channels = 2;
Expand Down Expand Up @@ -263,12 +274,15 @@ int64_t DVDPlayerCodec::Seek(int64_t iSeekTime)
CDVDDemuxUtils::FreeDemuxPacket(m_pPacket);
m_pPacket = NULL;

m_pDemuxer->SeekTime((int)iSeekTime, false);
bool ret = m_pDemuxer->SeekTime((int)iSeekTime, false);
m_pAudioCodec->Reset();

m_decoded = NULL;
m_nDecodedLen = 0;

if (!ret)
return DVD_NOPTS_VALUE;

return iSeekTime;
}

Expand Down Expand Up @@ -350,5 +364,5 @@ bool DVDPlayerCodec::CanInit()

bool DVDPlayerCodec::CanSeek()
{
return true;
return m_bCanSeek;
}
1 change: 1 addition & 0 deletions xbmc/cores/paplayer/DVDPlayerCodec.h
Expand Up @@ -63,6 +63,7 @@ class DVDPlayerCodec : public ICodec
CAEChannelInfo m_ChannelInfo;

bool m_bInited;
bool m_bCanSeek;
};

#endif

2 comments on commit 246d786

@FernetMenta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seen this? http://forum.xbmc.org/showthread.php?tid=179961&pid=1699864#pid1699864

Update : re-install youtube app on ipad resolved the problem

@quasar1
Copy link
Owner

@quasar1 quasar1 commented on 246d786 May 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes thanks just I cross posted... :)

Please sign in to comment.