diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2016-08-07 09:01:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-07 09:01:06 +0200 |
commit | ecc9bd15cb6b2c67160566eea5279b92776a08e3 (patch) | |
tree | 082f5f5835d0d1417e94c4560f81e83cdcacbd8f | |
parent | 70783f00ca2aba5600593ee91ef12f6480c84fb9 (diff) | |
parent | 04835e24b08769481bf56e12720ece082c06b27b (diff) |
Merge pull request #10237 from FernetMenta/stall
VideoPlayer: fix early stall of audio stream, sync is now in AE
-rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h | 4 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Interfaces/AEStream.h | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDAudio.cpp | 8 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDAudio.h | 5 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 9 |
6 files changed, 7 insertions, 27 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h index cfe6f2e053..7dbf7af342 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h @@ -194,8 +194,8 @@ public: virtual bool IsBuffering(); /** - * Returns the time in seconds that it will take - * to underrun the cache if no sample is added. + * Returns the time in seconds of the stream's + * cached audio samples. Engine buffers excluded. * @return seconds */ virtual double GetCacheTime(); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp index 5196c62cd0..07d35f6f56 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -197,9 +197,7 @@ void CEngineStats::GetSyncInfo(CAESyncInfo& info, CActiveAEStream *stream) float CEngineStats::GetCacheTime(CActiveAEStream *stream) { CSingleLock lock(m_lock); - float delay = (float)m_bufferedSamples / m_sinkSampleRate; - if (!m_pcmOutput) - delay = (float)m_bufferedSamples * m_sinkFormat.m_streamInfo.GetDuration() / 1000; + float delay = 0; for (auto &str : m_streamStats) { diff --git a/xbmc/cores/AudioEngine/Interfaces/AEStream.h b/xbmc/cores/AudioEngine/Interfaces/AEStream.h index 7416685ef7..533f6715d4 100644 --- a/xbmc/cores/AudioEngine/Interfaces/AEStream.h +++ b/xbmc/cores/AudioEngine/Interfaces/AEStream.h @@ -103,8 +103,8 @@ public: virtual bool IsBuffering() = 0; /** - * Returns the time in seconds that it will take - * to underrun the cache if no sample is added. + * Returns the time in seconds of the stream's + * cached audio samples. Engine buffers excluded. * @return seconds */ virtual double GetCacheTime() = 0; diff --git a/xbmc/cores/VideoPlayer/DVDAudio.cpp b/xbmc/cores/VideoPlayer/DVDAudio.cpp index 2674fb381a..2dd9b3689a 100644 --- a/xbmc/cores/VideoPlayer/DVDAudio.cpp +++ b/xbmc/cores/VideoPlayer/DVDAudio.cpp @@ -257,14 +257,6 @@ bool CDVDAudio::IsValidFormat(const DVDAudioFrame &audioframe) return true; } -void CDVDAudio::SetResampleRatio(double ratio) -{ - CSingleLock lock (m_critSection); - - if(m_pAudioStream) - m_pAudioStream->SetResampleRatio(ratio); -} - double CDVDAudio::GetCacheTime() { CSingleLock lock (m_critSection); diff --git a/xbmc/cores/VideoPlayer/DVDAudio.h b/xbmc/cores/VideoPlayer/DVDAudio.h index 48b5c42d29..81882a1a38 100644 --- a/xbmc/cores/VideoPlayer/DVDAudio.h +++ b/xbmc/cores/VideoPlayer/DVDAudio.h @@ -55,7 +55,7 @@ public: void Destroy(); unsigned int AddPackets(const DVDAudioFrame &audioframe); double GetPlayingPts(); - double GetCacheTime(); // returns total amount of data cached in audio output at this time + double GetCacheTime(); double GetCacheTotal(); // returns total amount the audio device can buffer double GetDelay(); // returns the time it takes to play a packet if we add one at this time double GetSyncError(); @@ -66,9 +66,6 @@ public: void Drain(); void AbortAddPackets(); - void SetSpeed(int iSpeed); - void SetResampleRatio(double ratio); - double GetClock(); double GetClockSpeed(); IAEStream *m_pAudioStream; diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp index 24228154ec..a0cae3e603 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp @@ -238,7 +238,7 @@ void CVideoPlayerAudio::Process() while (!m_bStop) { CDVDMsg* pMsg; - int timeout = (int)(1000 * m_dvdAudio.GetCacheTime()) + 100; + int timeout = (int)(1000 * m_dvdAudio.GetCacheTime()); // read next packet and return -1 on error int priority = 1; @@ -255,13 +255,6 @@ void CVideoPlayerAudio::Process() if (m_paused) priority = 1; - // consider stream stalled if queue is empty - // we can't sync audio to clock with an empty queue - if (ALLOW_AUDIO(m_speed) && !m_stalled && !m_paused) - { - timeout = 0; - } - MsgQueueReturnCode ret = m_messageQueue.Get(&pMsg, timeout, priority); if (MSGQ_IS_ERROR(ret)) |