Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3345 from FernetMenta/activefix

ActiveAE: check for sink errors on AddPackets
  • Loading branch information...
commit e3a642ff765454fec3b4a93e82ea6714d9099998 2 parents c828f88 + f468b7b
Peter Frühberger fritsch authored
2  xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
View
@@ -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)
{
9 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
View
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.