--- linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp 2013/03/01 23:00:17 2426 +++ linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp 2013/03/02 07:03:04 2427 @@ -4,7 +4,7 @@ * * * Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck * * Copyright (C) 2005-2008 Christian Schoenebeck * - * Copyright (C) 2009-2012 Christian Schoenebeck and Grigor Iliev * + * Copyright (C) 2009-2013 Christian Schoenebeck and Grigor Iliev * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -192,10 +192,8 @@ * device from other threads than the lscp thread. */ AudioOutputDevice* AbstractEngineChannel::GetAudioOutputDeviceSafe() { - EngineMutex.Lock(); - AudioOutputDevice* res = GetAudioOutputDevice(); - EngineMutex.Unlock(); - return res; + LockGuard lock(EngineMutex); + return GetAudioOutputDevice(); } void AbstractEngineChannel::SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) {