Skip to content
This repository
Browse code

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 authored September 29, 2013
2  xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
@@ -105,7 +105,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
105 105
     m_dst_chan_layout = 0;
106 106
     for (unsigned int out=0; out<remapLayout->Count(); out++)
107 107
     {
108  
-      m_dst_chan_layout += (1 << out);
  108
+      m_dst_chan_layout += (uint64_t) (1 << out);
109 109
       int idx = GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout);
110 110
       if (idx >= 0)
111 111
       {
9  xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
@@ -713,7 +713,7 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples)
713 713
   unsigned int frames = samples->pkt->nb_samples;
714 714
   unsigned int maxFrames;
715 715
   int retry = 0;
716  
-  int written = 0;
  716
+  unsigned int written = 0;
717 717
   double sinkDelay = 0.0;
718 718
 
719 719
   switch(m_convertState)
@@ -756,6 +756,13 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples)
756 756
       else
757 757
         continue;
758 758
     }
  759
+    else if (written > maxFrames)
  760
+    {
  761
+      m_extError = true;
  762
+      CLog::Log(LOGERROR, "CActiveAESink::OutputSamples - sink returned error");
  763
+      m_stats->UpdateSinkDelay(0, samples->pool ? maxFrames : 0);
  764
+      return 0;
  765
+    }
759 766
     frames -= written;
760 767
     buffer += written*m_sinkFormat.m_frameSize;
761 768
     sinkDelay = m_sink->GetDelay();

0 notes on commit e3a642f

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