[Scummvm-git-logs] scummvm master -> 20e628cac33ab199d17bacae3d307569fb2fc0f2
criezy
criezy at scummvm.org
Tue Sep 12 22:48:21 CEST 2017
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3607b79d7d MACOSX: Remove mixer init from derived class for macosx backend
629ea05ffc GPH: Remove unused include
f7436a9b3a OPENPANDORA: Remove unused include
20e628cac3 SDL: Remove code for unused DoubleBufferSDLMixerManager
Commit: 3607b79d7d584e2b37c0ef84baa23df0bacc2c67
https://github.com/scummvm/scummvm/commit/3607b79d7d584e2b37c0ef84baa23df0bacc2c67
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-09-12T21:30:29+01:00
Commit Message:
MACOSX: Remove mixer init from derived class for macosx backend
Since the macosx backend now does the same as the base SDL backend
we can just let the base class do its stuff.
Changed paths:
backends/platform/sdl/macosx/macosx.cpp
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 457746c..8ecbe73 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -28,7 +28,6 @@
#ifdef MACOSX
#include "backends/audiocd/macosx/macosx-audiocd.h"
-#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/platform/sdl/macosx/appmenu_osx.h"
#include "backends/platform/sdl/macosx/macosx.h"
#include "backends/updates/macosx/macosx-updates.h"
@@ -62,14 +61,6 @@ void OSystem_MacOSX::init() {
}
void OSystem_MacOSX::initBackend() {
- // Create the mixer manager
- if (_mixer == 0) {
- _mixerManager = new SdlMixerManager();
-
- // Setup and start mixer
- _mixerManager->init();
- }
-
#ifdef USE_TRANSLATION
// We need to initialize the translataion manager here for the following
// call to replaceApplicationMenuItems() work correctly
Commit: 629ea05ffc4e385b78c9fb4d8265d5ce82d44b9b
https://github.com/scummvm/scummvm/commit/629ea05ffc4e385b78c9fb4d8265d5ce82d44b9b
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-09-12T21:37:52+01:00
Commit Message:
GPH: Remove unused include
The use of DoubleBufferSDLMixerManager in the GPH backend was removed
in commit 3b6398c but the include for it was left behind.
Changed paths:
backends/platform/gph/gph-backend.cpp
diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp
index fb1cbe0..96f4262 100644
--- a/backends/platform/gph/gph-backend.cpp
+++ b/backends/platform/gph/gph-backend.cpp
@@ -27,7 +27,6 @@
#include "backends/platform/sdl/sdl-sys.h"
-#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/platform/gph/gph-hw.h"
#include "backends/platform/gph/gph.h"
#include "backends/plugins/posix/posix-provider.h"
Commit: f7436a9b3a95fef90ec8001d0381b6aa44e2d008
https://github.com/scummvm/scummvm/commit/f7436a9b3a95fef90ec8001d0381b6aa44e2d008
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-09-12T21:41:55+01:00
Commit Message:
OPENPANDORA: Remove unused include
The use of DoubleBufferSDLMixerManager in the OpenPandora backend was
removed in commit b157269 but the include for it was left behind.
Changed paths:
backends/platform/openpandora/op-backend.cpp
diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp
index e7975a6..0d81ef8 100644
--- a/backends/platform/openpandora/op-backend.cpp
+++ b/backends/platform/openpandora/op-backend.cpp
@@ -27,7 +27,6 @@
#include "backends/platform/sdl/sdl-sys.h"
-#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/platform/openpandora/op-sdl.h"
#include "backends/plugins/posix/posix-provider.h"
#include "backends/saves/default/default-saves.h"
Commit: 20e628cac33ab199d17bacae3d307569fb2fc0f2
https://github.com/scummvm/scummvm/commit/20e628cac33ab199d17bacae3d307569fb2fc0f2
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-09-12T21:46:20+01:00
Commit Message:
SDL: Remove code for unused DoubleBufferSDLMixerManager
Changed paths:
R backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
R backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
backends/module.mk
diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
deleted file mode 100644
index ea0ba02..0000000
--- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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 the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if defined(MACOSX) || defined(GP2X) || defined(CAANOO) || defined(GP2XWIZ)
-
-#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
-
-DoubleBufferSDLMixerManager::DoubleBufferSDLMixerManager()
- :
- _soundMutex(0), _soundCond(0), _soundThread(0),
- _soundThreadIsRunning(false), _soundThreadShouldQuit(false) {
-
-}
-
-DoubleBufferSDLMixerManager::~DoubleBufferSDLMixerManager() {
- deinitThreadedMixer();
-}
-
-void DoubleBufferSDLMixerManager::startAudio() {
- _soundThreadIsRunning = false;
- _soundThreadShouldQuit = false;
-
- // Create mutex and condition variable
- _soundMutex = SDL_CreateMutex();
- _soundCond = SDL_CreateCond();
-
- // Create two sound buffers
- _activeSoundBuf = 0;
- uint bufSize = _obtained.samples * 4;
- _soundBufSize = bufSize;
- _soundBuffers[0] = (byte *)calloc(1, bufSize);
- _soundBuffers[1] = (byte *)calloc(1, bufSize);
-
- _soundThreadIsRunning = true;
-
- // Finally start the thread
-#if SDL_VERSION_ATLEAST(2, 0, 0)
- _soundThread = SDL_CreateThread(mixerProducerThreadEntry, "ScummVM Double Buffer Mixer", this);
-#else
- _soundThread = SDL_CreateThread(mixerProducerThreadEntry, this);
-#endif
-
- SdlMixerManager::startAudio();
-}
-
-SDL_AudioSpec DoubleBufferSDLMixerManager::getAudioSpec(uint32 rate) {
- SDL_AudioSpec desired = SdlMixerManager::getAudioSpec(rate);
- // Don't double audio latency when double buffering
- desired.samples /= 2;
- return desired;
-}
-
-void DoubleBufferSDLMixerManager::mixerProducerThread() {
- byte nextSoundBuffer;
-
- SDL_LockMutex(_soundMutex);
- while (true) {
- // Wait till we are allowed to produce data
- SDL_CondWait(_soundCond, _soundMutex);
-
- if (_soundThreadShouldQuit)
- break;
-
- // Generate samples and put them into the next buffer
- nextSoundBuffer = _activeSoundBuf ^ 1;
- _mixer->mixCallback(_soundBuffers[nextSoundBuffer], _soundBufSize);
-
- // Swap buffers
- _activeSoundBuf = nextSoundBuffer;
- }
- SDL_UnlockMutex(_soundMutex);
-}
-
-int SDLCALL DoubleBufferSDLMixerManager::mixerProducerThreadEntry(void *arg) {
- DoubleBufferSDLMixerManager *mixer = (DoubleBufferSDLMixerManager *)arg;
- assert(mixer);
- mixer->mixerProducerThread();
- return 0;
-}
-
-void DoubleBufferSDLMixerManager::deinitThreadedMixer() {
- // Kill thread?? _soundThread
-
- if (_soundThreadIsRunning) {
- // Signal the producer thread to end, and wait for it to actually finish.
- _soundThreadShouldQuit = true;
- SDL_CondBroadcast(_soundCond);
- SDL_WaitThread(_soundThread, NULL);
-
- // Kill the mutex & cond variables.
- // Attention: AT this point, the mixer callback must not be running
- // anymore, else we will crash!
- SDL_DestroyMutex(_soundMutex);
- SDL_DestroyCond(_soundCond);
-
- _soundThreadIsRunning = false;
-
- free(_soundBuffers[0]);
- free(_soundBuffers[1]);
- }
-}
-
-void DoubleBufferSDLMixerManager::callbackHandler(byte *samples, int len) {
- assert(_mixer);
- assert((int)_soundBufSize == len);
-
- // Lock mutex, to ensure our data is not overwritten by the producer thread
- SDL_LockMutex(_soundMutex);
-
- // Copy data from the current sound buffer
- memcpy(samples, _soundBuffers[_activeSoundBuf], len);
-
- // Unlock mutex and wake up the produced thread
- SDL_UnlockMutex(_soundMutex);
- SDL_CondSignal(_soundCond);
-}
-
-#endif
diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
deleted file mode 100644
index e952cd2..0000000
--- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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 the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef BACKENDS_MIXER_DOUBLEBUFFERSDL_H
-#define BACKENDS_MIXER_DOUBLEBUFFERSDL_H
-
-#include "backends/mixer/sdl/sdl-mixer.h"
-
-/**
- * SDL mixer manager with double buffering support.
- */
-class DoubleBufferSDLMixerManager : public SdlMixerManager {
-public:
- DoubleBufferSDLMixerManager();
- virtual ~DoubleBufferSDLMixerManager();
-
-protected:
- SDL_mutex *_soundMutex;
- SDL_cond *_soundCond;
- SDL_Thread *_soundThread;
- bool _soundThreadIsRunning;
- bool _soundThreadShouldQuit;
-
- byte _activeSoundBuf;
- uint _soundBufSize;
- byte *_soundBuffers[2];
-
- virtual SDL_AudioSpec getAudioSpec(uint32 rate) override;
-
- /**
- * Handles and swap the sound buffers
- */
- void mixerProducerThread();
-
- /**
- * Finish the mixer manager
- */
- void deinitThreadedMixer();
-
- /**
- * Callback entry point for the sound thread
- */
- static int SDLCALL mixerProducerThreadEntry(void *arg);
-
- virtual void startAudio();
- virtual void callbackHandler(byte *samples, int len);
-};
-
-#endif
diff --git a/backends/module.mk b/backends/module.mk
index d8b518b..5d8c912 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -139,7 +139,6 @@ MODULE_OBJS += \
events/sdl/sdl-events.o \
graphics/sdl/sdl-graphics.o \
graphics/surfacesdl/surfacesdl-graphics.o \
- mixer/doublebuffersdl/doublebuffersdl-mixer.o \
mixer/sdl/sdl-mixer.o \
mutex/sdl/sdl-mutex.o \
plugins/sdl/sdl-provider.o \
More information about the Scummvm-git-logs
mailing list