- better looping sound

This commit is contained in:
Simon Morris
2014-03-17 13:56:46 +00:00
parent 1e77247b38
commit 80c8bf76df

View File

@@ -1009,13 +1009,13 @@ namespace lime
if (active && !playing())
alSourcePlay(source);
if (!active && mLoops > 0)
/*if (!active && mLoops > 0)
{
mLoops --;
double seek = mStartTime * 0.001;
ov_time_seek(oggStream, seek);
return update();
}
}*/
return active;
@@ -1037,7 +1037,13 @@ namespace lime
size += result;
else
if(result < 0) {
if ( mLoops > 0 ) {
mLoops --;
ov_time_seek(oggStream, 0);
}else{
break;
}
//LOG_SOUND ("Result is less than 0");
//throw errorString(result);
}
@@ -1045,10 +1051,18 @@ namespace lime
break;
}
if(size <= 0) {
if ( mLoops > 0 ) {
mLoops --;
ov_time_seek(oggStream, 0);
return stream( buffer );
}else{
alSourceStop(source);
return false;
}
}
alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
check();
return true;