Skip to content
This repository
Browse code

[rbp/omxplayer] Add logging for when audio/video EOS is first detected

This is useful for diagnosing streams that hang at end of file
  • Loading branch information...
commit 40d39492dda7d490877f83f9536d86dbae3b7fb9 1 parent 62860e9
popcornmix authored
18  xbmc/cores/omxplayer/OMXAudio.cpp
@@ -112,7 +112,8 @@ COMXAudio::COMXAudio() :
112 112
   m_eEncoding       (OMX_AUDIO_CodingPCM),
113 113
   m_extradata       (NULL   ),
114 114
   m_extrasize       (0      ),
115  
-  m_last_pts        (DVD_NOPTS_VALUE)
  115
+  m_last_pts        (DVD_NOPTS_VALUE),
  116
+  m_submitted_eos   (false  )
116 117
 {
117 118
   m_vizBufferSize   = m_vizRemapBufferSize = VIS_PACKET_SIZE * sizeof(float);
118 119
   m_vizRemapBuffer  = (uint8_t *)_aligned_malloc(m_vizRemapBufferSize,16);
@@ -570,6 +571,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *
570 571
   m_Initialized   = true;
571 572
   m_settings_changed = false;
572 573
   m_setStartTime = true;
  574
+  m_submitted_eos = false;
573 575
   m_last_pts      = DVD_NOPTS_VALUE;
574 576
 
575 577
   CLog::Log(LOGDEBUG, "COMXAudio::Initialize Input bps %d samplerate %d channels %d buffer size %d bytes per second %d", 
@@ -1016,6 +1018,8 @@ void COMXAudio::SubmitEOS()
1016 1018
   if(!m_Initialized)
1017 1019
     return;
1018 1020
 
  1021
+  m_submitted_eos = true;
  1022
+
1019 1023
   OMX_ERRORTYPE omx_err = OMX_ErrorNone;
1020 1024
   OMX_BUFFERHEADERTYPE *omx_buffer = m_omx_decoder.GetInputBuffer();
1021 1025
 
@@ -1037,6 +1041,7 @@ void COMXAudio::SubmitEOS()
1037 1041
     CLog::Log(LOGERROR, "%s::%s - OMX_EmptyThisBuffer() failed with result(0x%x)\n", CLASSNAME, __func__, omx_err);
1038 1042
     return;
1039 1043
   }
  1044
+  CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__);
1040 1045
 }
1041 1046
 
1042 1047
 bool COMXAudio::IsEOS()
@@ -1045,7 +1050,16 @@ bool COMXAudio::IsEOS()
1045 1050
     return true;
1046 1051
   unsigned int latency = GetAudioRenderingLatency();
1047 1052
   CSingleLock lock (m_critSection);
1048  
-  return m_omx_decoder.IsEOS() && latency <= 0;
  1053
+
  1054
+  if (!(m_omx_decoder.IsEOS() && latency == 0))
  1055
+    return false;
  1056
+
  1057
+  if (m_submitted_eos)
  1058
+  {
  1059
+    CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__);
  1060
+    m_submitted_eos = false;
  1061
+  }
  1062
+  return true;
1049 1063
 }
1050 1064
 
1051 1065
 void COMXAudio::SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers)
1  xbmc/cores/omxplayer/OMXAudio.h
@@ -124,6 +124,7 @@ class COMXAudio
124 124
   int           m_vizRemapBufferSize;
125 125
   uint8_t       *m_vizRemapBuffer;
126 126
   CAERemap      m_vizRemap;
  127
+  bool          m_submitted_eos;
127 128
 
128 129
   OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_output;
129 130
   OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_input;
10  xbmc/cores/omxplayer/OMXVideo.cpp
@@ -888,11 +888,19 @@ void COMXVideo::SubmitEOS()
888 888
     CLog::Log(LOGERROR, "%s::%s - OMX_EmptyThisBuffer() failed with result(0x%x)\n", CLASSNAME, __func__, omx_err);
889 889
     return;
890 890
   }
  891
+  CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__);
891 892
 }
892 893
 
893 894
 bool COMXVideo::IsEOS()
894 895
 {
895 896
   if(!m_is_open)
896 897
     return true;
897  
-  return m_omx_render.IsEOS();
  898
+  if (!m_omx_render.IsEOS())
  899
+    return false;
  900
+  if (m_submitted_eos)
  901
+  {
  902
+    CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__);
  903
+    m_submitted_eos = false;
  904
+  }
  905
+  return true;
898 906
 }

0 notes on commit 40d3949

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