Skip to content
This repository
Browse code

[AE/CA] - stop and start the engine in makestream only when we need t…

…o reinit due to format change or when we are NOT called with the AESTREAM_PAUSED option. (AESTREAM_PAUSED is set from paplayer) - this should further reduce the hickup with slaved streams in paplayer
  • Loading branch information...
commit 80c5ec2f08180a7208a428d4d06f5f8e7a541d3f 1 parent 52aa242
Memphiz authored November 22, 2012
8  xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
@@ -436,7 +436,8 @@ IAEStream* CCoreAudioAE::MakeStream(enum AEDataFormat dataFormat,
436 436
   m_streams.push_back(stream);
437 437
   streamLock.Leave();
438 438
 
439  
-  Stop();
  439
+  if ((options & AESTREAM_PAUSED) == 0)
  440
+    Stop();
440 441
 
441 442
   // reinit the engine if pcm format changes or always on raw format
442 443
   if (m_Initialized && ( m_lastStreamFormat != dataFormat ||
@@ -444,18 +445,21 @@ IAEStream* CCoreAudioAE::MakeStream(enum AEDataFormat dataFormat,
444 445
                          m_lastSampleRate != sampleRate ||
445 446
                          COREAUDIO_IS_RAW(dataFormat)))
446 447
   {
  448
+    Stop();
447 449
     Deinitialize();
448 450
     m_Initialized = OpenCoreAudio(sampleRate, COREAUDIO_IS_RAW(dataFormat), dataFormat);
449 451
     m_lastStreamFormat = dataFormat;
450 452
     m_lastChLayoutCount = channelLayout.Count();
451 453
     m_lastSampleRate = sampleRate;
  454
+    Start();
452 455
   }
453 456
 
454 457
   /* if the stream was not initialized, do it now */
455 458
   if (!stream->IsValid())
456 459
     stream->Initialize();
457 460
 
458  
-  Start();
  461
+  if ((options & AESTREAM_PAUSED) == 0)  
  462
+    Start();
459 463
 
460 464
   m_streamsPlaying = true;
461 465
 

0 notes on commit 80c5ec2

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