Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not access m_pVideoCodec from dvdplayer thread #7620

Merged
merged 3 commits into from
Jul 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,9 +1867,7 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts)
if (m_old_pictcnt == m_cur_pictcnt)
m_ready_event.WaitMSec(25);

// we must return VC_BUFFER or VC_PICTURE,
// default to VC_BUFFER.
int rtn = VC_BUFFER;
int rtn = 0;
if (m_old_pictcnt != m_cur_pictcnt)
{
m_old_pictcnt++;
Expand Down
16 changes: 0 additions & 16 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,6 @@ class CDVDVideoCodec
*/
virtual void SetSpeed(int iSpeed) {};

/*
* returns the number of demuxer bytes in any internal buffers
*/
virtual int GetDataSize(void)
{
return 0;
}

/*
* returns the time in seconds for demuxer bytes in any internal buffers
*/
virtual double GetTimeSize(void)
{
return 0;
}

enum EFilterFlags {
FILTER_NONE = 0x0,
FILTER_DEINTERLACE_YADIF = 0x1, /* use first deinterlace mode */
Expand Down
28 changes: 0 additions & 28 deletions xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,34 +809,6 @@ void CDVDPlayerVideo::Flush()
m_messageQueue.Put(new CDVDMsg(CDVDMsg::GENERAL_FLUSH), 1);
}

int CDVDPlayerVideo::GetLevel() const
{
int level = m_messageQueue.GetLevel();

// fast exit, if the message queue is full, we do not care about the codec queue.
if (level == 100)
return level;

// Now for the harder choices, the message queue could be time or size based.
// In order to return the proper summed level, we need to know which.
if (m_messageQueue.IsDataBased())
{
int datasize = m_messageQueue.GetDataSize();
if (m_pVideoCodec)
datasize += m_pVideoCodec->GetDataSize();
return min(100, MathUtils::round_int((100.0 * datasize) / m_messageQueue.GetMaxDataSize()));
}
else
{
double timesize = m_messageQueue.GetTimeSize();
if (m_pVideoCodec)
timesize += m_pVideoCodec->GetTimeSize();
return min(100, MathUtils::round_int(100.0 * m_messageQueue.GetMaxTimeSize() * timesize));
}

return level;
}

#ifdef HAS_VIDEO_PLAYBACK
void CDVDPlayerVideo::ProcessOverlays(DVDVideoPicture* pSource, double pts)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDPlayerVideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CDVDPlayerVideo : public CThread, public IDVDStreamPlayerVideo
void WaitForBuffers() { m_messageQueue.WaitUntilEmpty(); }
bool AcceptsData() const { return !m_messageQueue.IsFull(); }
bool HasData() const { return m_messageQueue.GetDataSize() > 0; }
int GetLevel() const;
int GetLevel() const { return m_messageQueue.GetLevel(); }
bool IsInited() const { return m_messageQueue.IsInited(); }
void SendMessage(CDVDMsg* pMsg, int priority = 0) { m_messageQueue.Put(pMsg, priority); }
void FlushMessages() { m_messageQueue.Flush(); }
Expand Down