From 665f72edf1ef42f2b4c082c289200264016f9080 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Mon, 2 Dec 2013 02:17:21 -0800 Subject: [PATCH] Minor adjustments, and fixes to streaming audio --- project/include/Audio.h | 3 +++ project/src/platform/tizen/TizenApplication.cpp | 6 +++--- project/src/sound/openal/OpenALSound.cpp | 12 +++--------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/project/include/Audio.h b/project/include/Audio.h index 918e95fe1..1a746b607 100644 --- a/project/include/Audio.h +++ b/project/include/Audio.h @@ -16,6 +16,9 @@ #ifdef IPHONE //#define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__) #define LOG_SOUND(args...) { } +#elif defined(TIZEN) +#include +#define LOG_SOUND(args,...) AppLog(args, ##__VA_ARGS__) #else #define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__) #endif diff --git a/project/src/platform/tizen/TizenApplication.cpp b/project/src/platform/tizen/TizenApplication.cpp index e13f5f349..9b3bbf7bb 100644 --- a/project/src/platform/tizen/TizenApplication.cpp +++ b/project/src/platform/tizen/TizenApplication.cpp @@ -237,9 +237,6 @@ namespace lime { } - Event poll (etPoll); - sgTizenFrame->HandleEvent (poll); - double next = sgTizenFrame->GetStage ()->GetNextWake () - GetTimeStamp (); if (next > 0.001) { @@ -252,6 +249,9 @@ namespace lime { } + Event poll (etPoll); + sgTizenFrame->HandleEvent (poll); + } diff --git a/project/src/sound/openal/OpenALSound.cpp b/project/src/sound/openal/OpenALSound.cpp index 4c8e4665a..e7e852e89 100644 --- a/project/src/sound/openal/OpenALSound.cpp +++ b/project/src/sound/openal/OpenALSound.cpp @@ -977,7 +977,7 @@ namespace lime if (mSuspend) return true; if (!mIsValid) return false; - int processed; + int processed = 0; bool active = true; alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); @@ -985,22 +985,16 @@ namespace lime while(processed--) { ALuint buffer; - alSourceUnqueueBuffers(source, 1, &buffer); - check(); + alGetError(); - if (mIsValid) + if (buffer) { active = stream(buffer); alSourceQueueBuffers(source, 1, &buffer); check(); } - else - { - active = false; - break; - } } if (active && !playing())