diff options
author | Peter Frühberger <Peter.Fruehberger@gmail.com> | 2013-09-29 07:56:46 -0700 |
---|---|---|
committer | Peter Frühberger <Peter.Fruehberger@gmail.com> | 2013-09-29 07:56:46 -0700 |
commit | e3a642ff765454fec3b4a93e82ea6714d9099998 (patch) | |
tree | aaad2d6e979577936493b72fc4f88189ae832c06 | |
parent | c828f8810e0d47d71498008ad6ad834d2c893f51 (diff) | |
parent | f468b7bec02fc01556fa8b2711e32a482409457f (diff) |
Merge pull request #3345 from FernetMenta/activefix
ActiveAE: check for sink errors on AddPackets
-rw-r--r-- | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp index 4070b818f5..2c5f41bb69 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp @@ -105,7 +105,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst m_dst_chan_layout = 0; for (unsigned int out=0; out<remapLayout->Count(); out++) { - m_dst_chan_layout += (1 << out); + m_dst_chan_layout += (uint64_t) (1 << out); int idx = GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout); if (idx >= 0) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp index 077ef2e3ff..295951078f 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp @@ -713,7 +713,7 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples) unsigned int frames = samples->pkt->nb_samples; unsigned int maxFrames; int retry = 0; - int written = 0; + unsigned int written = 0; double sinkDelay = 0.0; switch(m_convertState) @@ -756,6 +756,13 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples) else continue; } + else if (written > maxFrames) + { + m_extError = true; + CLog::Log(LOGERROR, "CActiveAESink::OutputSamples - sink returned error"); + m_stats->UpdateSinkDelay(0, samples->pool ? maxFrames : 0); + return 0; + } frames -= written; buffer += written*m_sinkFormat.m_frameSize; sinkDelay = m_sink->GetDelay(); |