From d240a2832279342b6f46535218bcf46c3c1e2a54 Mon Sep 17 00:00:00 2001 From: driAn Date: Tue, 18 May 2010 16:44:08 +0000 Subject: [PATCH] audio debugging git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4912 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/openal.cpp | 2 ++ source/src/soundlocation.cpp | 3 ++- source/src/soundscheduler.cpp | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/src/openal.cpp b/source/src/openal.cpp index 14109dd5..5322eb20 100644 --- a/source/src/openal.cpp +++ b/source/src/openal.cpp @@ -23,6 +23,7 @@ source::~source() void source::lock() { locked = true; + DEBUG("source locked, " << lastmillis); } void source::unlock() @@ -31,6 +32,7 @@ void source::unlock() owner = NULL; stop(); buffer(0); + DEBUG("source unlocked, " << lastmillis); } void source::reset() diff --git a/source/src/soundlocation.cpp b/source/src/soundlocation.cpp index 0b92a581..954220d7 100644 --- a/source/src/soundlocation.cpp +++ b/source/src/soundlocation.cpp @@ -170,7 +170,8 @@ void location::update() case AL_STOPPED: case AL_PAUSED: case AL_INITIAL: - stale = true; + stale = true; + DEBUG("location is stale"); break; } } diff --git a/source/src/soundscheduler.cpp b/source/src/soundscheduler.cpp index eb55c46b..c5ea501c 100644 --- a/source/src/soundscheduler.cpp +++ b/source/src/soundscheduler.cpp @@ -147,12 +147,16 @@ void sourcescheduler::releasesource(source *src) ASSERT(src->locked); // detect double release if(!src) return; - src->unlock(); + + DEBUG("unlocking source"); + + src->unlock(); if(sources.length() > numsoundchannels) { sources.removeobj(src); delete src; + DEBUG("source deleted"); } }