Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[omxplayer] fixed wait on omx completition to ensure all data is rend…

…ered and added a debug log message to see if we hit EOS.
  • Loading branch information...
commit fae30c3a101da8a0a121d07b736d7a6f4fc6d5c9 1 parent 4e02fe9
huceke huceke authored
3  xbmc/cores/omxplayer/OMXAudio.cpp
View
@@ -1180,7 +1180,10 @@ void COMXAudio::WaitCompletion()
while(nTimeOut)
{
if(m_omx_render->IsEOS())
+ {
+ CLog::Log(LOGDEBUG, "%s::%s - got eos\n", CLASSNAME, __func__);
break;
+ }
if(nTimeOut == 0)
{
12 xbmc/cores/omxplayer/OMXPlayer.cpp
View
@@ -1244,6 +1244,18 @@ void COMXPlayer::Process()
continue;
}
+ // wait for omx components to fimish
EricV
EricV added a note

Should be finish

huceke Collaborator
huceke added a note

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ if(HasVideo() && !m_player_video.IsEOS())
+ {
+ Sleep(100);
+ continue;
+ }
+ if(HasAudio() && !m_player_audio.IsEOS())
+ {
+ Sleep(100);
+ continue;
+ }
+
if (!m_pInputStream->IsEOF())
CLog::Log(LOGINFO, "%s - eof reading from demuxer", __FUNCTION__);
6 xbmc/cores/omxplayer/OMXPlayerAudio.cpp
View
@@ -78,6 +78,7 @@ OMXPlayerAudio::OMXPlayerAudio(OMXClock *av_clock,
m_nChannels = 0;
m_DecoderOpen = false;
m_freq = CurrentHostFrequency();
+ m_send_eos = false;
m_hints_current.Clear();
m_av_clock->SetMasterClock(false);
@@ -150,6 +151,7 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec)
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
m_use_passthrough = (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI) ? true : false ;
m_use_hw_decode = g_advancedSettings.m_omxHWAudioDecode;
+ m_send_eos = false;
}
bool OMXPlayerAudio::CloseStream(bool bWaitForBuffers)
@@ -775,7 +777,9 @@ double OMXPlayerAudio::GetCacheTime()
void OMXPlayerAudio::WaitCompletion()
{
- m_omxAudio.WaitCompletion();
+ if(!m_send_eos)
+ m_omxAudio.WaitCompletion();
+ m_send_eos = true;
}
void OMXPlayerAudio::RegisterAudioCallback(IAudioCallback *pCallback)
2  xbmc/cores/omxplayer/OMXPlayerAudio.h
View
@@ -88,6 +88,7 @@ class OMXPlayerAudio : public CThread
bool m_DecoderOpen;
DllBcmHost m_DllBcmHost;
+ bool m_send_eos;
virtual void OnStartup();
virtual void OnExit();
@@ -104,6 +105,7 @@ class OMXPlayerAudio : public CThread
bool IsInited() const { return m_messageQueue.IsInited(); }
int GetLevel() const { return m_messageQueue.GetLevel(); }
bool IsStalled() { return m_stalled; }
+ bool IsEOS() { return m_send_eos; };
void WaitForBuffers();
bool CloseStream(bool bWaitForBuffers);
bool CodecChange();
8 xbmc/cores/omxplayer/OMXPlayerVideo.cpp
View
@@ -95,6 +95,7 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock,
m_dropbase = 0.0;
m_autosync = 1;
m_fForcedAspectRatio = 0.0f;
+ m_send_eos = false;
m_messageQueue.SetMaxDataSize(10 * 1024 * 1024);
m_messageQueue.SetMaxTimeSize(8.0);
@@ -157,6 +158,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints)
*/
m_open = true;
+ m_send_eos = false;
return true;
}
@@ -706,7 +708,7 @@ bool OMXPlayerVideo::OpenDecoder()
if(!bVideoDecoderOpen)
{
- CLog::Log(LOGERROR, "OMXPlayerAudio : Error open video output");
+ CLog::Log(LOGERROR, "OMXPlayerVideo : Error open video output");
m_omxVideo.Close();
}
else
@@ -746,7 +748,9 @@ int OMXPlayerVideo::GetDecoderFreeSpace()
void OMXPlayerVideo::WaitCompletion()
{
- m_omxVideo.WaitCompletion();
+ if(!m_send_eos)
+ m_omxVideo.WaitCompletion();
+ m_send_eos = true;
}
void OMXPlayerVideo::SetSpeed(int speed)
2  xbmc/cores/omxplayer/OMXPlayerVideo.h
View
@@ -81,6 +81,7 @@ class OMXPlayerVideo : public CThread
int m_view_mode;
DllBcmHost m_DllBcmHost;
+ bool m_send_eos;
CDVDOverlayContainer *m_pOverlayContainer;
CDVDMessageQueue &m_messageParent;
@@ -107,6 +108,7 @@ class OMXPlayerVideo : public CThread
void WaitForBuffers() { m_messageQueue.WaitUntilEmpty(); }
int GetLevel() const { return m_messageQueue.GetLevel(); }
bool IsStalled() { return m_stalled; }
+ bool IsEOS() { return m_send_eos; };
bool CloseStream(bool bWaitForBuffers);
void Output(int iGroupId, double pts, bool bDropPacket);
void Flush();
5 xbmc/cores/omxplayer/OMXVideo.cpp
View
@@ -949,12 +949,15 @@ void COMXVideo::WaitCompletion()
return;
}
- unsigned int nTimeOut = 5000;
+ unsigned int nTimeOut = 30000;
while(nTimeOut)
{
if(m_omx_render.IsEOS())
+ {
+ CLog::Log(LOGDEBUG, "%s::%s - got eos\n", CLASSNAME, __func__);
break;
+ }
if(nTimeOut == 0)
{
Please sign in to comment.
Something went wrong with that request. Please try again.