aboutsummaryrefslogtreecommitdiff
path: root/src/library_openal.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-22 16:22:16 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-22 16:22:16 -0700
commita8e4801c7d38033fff760ea26a4579aa324e303e (patch)
tree01c8c9862f7a6e1b60569aa9be97fd2751be8709 /src/library_openal.js
parent669c786e3554b280e31dcb7bd92931482547dae0 (diff)
parentf99012f271c056ddc171f6a4ec011ad31ad936cd (diff)
Merge branch 'incoming'
Diffstat (limited to 'src/library_openal.js')
-rw-r--r--src/library_openal.js28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/library_openal.js b/src/library_openal.js
index 719d8cf8..df1d15db 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -57,7 +57,6 @@ var LibraryOpenAL = {
}
if (ctx) {
- ctx.listener.panningModel = "equalpower";
AL.contexts.push({ctx: ctx, err: 0, src: [], buf: []});
return AL.contexts.length;
} else {
@@ -73,6 +72,12 @@ var LibraryOpenAL = {
}
},
+ alcGetError__deps: ['alGetError'],
+ alcGetError: function(device) {
+ // We have only one audio device, so just return alGetError.
+ return _alGetError();
+ },
+
alDeleteSources: function(count, sources)
{
if (!AL.currentContext) {
@@ -97,14 +102,9 @@ var LibraryOpenAL = {
for (var i = 0; i < count; ++i) {
var gain = AL.currentContext.ctx.createGain();
var panner = AL.currentContext.ctx.createPanner();
- if (typeof(webkitAudioContext) == 'function') {
- gain.connect(panner);
- panner.connect(AL.currentContext.ctx.destination);
- } else {
- // Work around a Firefox bug (bug 849916)
- gain.connect(AL.currentContext.ctx.destination);
- }
- gain.gain.value = 1; // work around a Firefox bug (bug 850970)
+ panner.panningModel = "equalpower";
+ gain.connect(panner);
+ panner.connect(AL.currentContext.ctx.destination);
AL.currentContext.src.push({
loop: false,
buffer: null,
@@ -404,8 +404,7 @@ var LibraryOpenAL = {
src.buffer = AL.currentContext.src[source - 1].buffer;
src.connect(AL.currentContext.src[source - 1].gain);
src.start(0, offset);
- // Work around Firefox bug 851338
- AL.currentContext.src[source - 1].playTime = AL.currentContext.ctx.currentTime || 0;
+ AL.currentContext.src[source - 1].playTime = AL.currentContext.ctx.currentTime;
AL.currentContext.src[source - 1].paused = false;
AL.currentContext.src[source - 1]['src'] = src;
},
@@ -445,8 +444,7 @@ var LibraryOpenAL = {
if ("src" in AL.currentContext.src[source - 1] &&
!AL.currentContext.src[source - 1].paused) {
AL.currentContext.src[source - 1].paused = true;
- // Work around Firefox bug 851338
- AL.currentContext.src[source - 1].pausedTime = AL.currentContext.ctx.currentTime || 0;
+ AL.currentContext.src[source - 1].pausedTime = AL.currentContext.ctx.currentTime;
AL.currentContext.src[source - 1]["src"].stop(0);
delete AL.currentContext.src[source - 1].src;
}
@@ -572,10 +570,6 @@ var LibraryOpenAL = {
alcGetProcAddress: function(device, fname) {
return 0;
},
-
- alcGetError: function(device) {
- return 0;
- },
};
autoAddDeps(LibraryOpenAL, '$AL');