From e842ef6a5816cabe7eceaa873799cabf2334f47e Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sat, 10 Mar 2012 09:29:12 +0100 Subject: [PATCH] new order in portaudio decoding loop --- Vocaluxe/Lib/Sound/CPortAudioPlay.cs | 34 ++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Vocaluxe/Lib/Sound/CPortAudioPlay.cs b/Vocaluxe/Lib/Sound/CPortAudioPlay.cs index 43623c5c..dc23bc91 100644 --- a/Vocaluxe/Lib/Sound/CPortAudioPlay.cs +++ b/Vocaluxe/Lib/Sound/CPortAudioPlay.cs @@ -677,6 +677,21 @@ namespace Vocaluxe.Lib.Sound { if (EventDecode.WaitOne(10)) { + lock (MutexSyncSignals) + { + if (_SetSkip) + { + _skip = true; + EventDecode.Set(); + _waiting = true; + } + + _SetSkip = false; + + _Start = _SetStart; + _Loop = _SetLoop; + } + if (_skip) { DoSkip(); @@ -689,25 +704,6 @@ namespace Vocaluxe.Lib.Sound Update(); } } - - if (!_terminated) - { - lock (MutexSyncSignals) - { - if (_SetSkip) - { - _skip = true; - EventDecode.Set(); - _waiting = true; - } - - _SetSkip = false; - - _Start = _SetStart; - _Loop = _SetLoop; - } - } - } DoFree();