From aa43d2fe656ed1815c53523783f509f8c2d64d67 Mon Sep 17 00:00:00 2001 From: Squareys Date: Fri, 18 Aug 2017 10:16:51 +0200 Subject: [PATCH] Audio: Clear error for alcCreateContext failure on emscripten Emscripten AL does not support specifying attributes and does not set a ALC error when alcCreateContext fails. Signed-off-by: Squareys --- src/Magnum/Audio/Context.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index e834f6ebc..3229fe1fc 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -228,7 +228,16 @@ bool Context::tryCreateContext(const Configuration& config) { attributes[last++] = config.refreshRate(); } +#ifndef CORRADE_TARGET_EMSCRIPTEN _context = alcCreateContext(_device, attributes); +#else + /* Attribute list currently not supported by emscripten */ + if(last != 0) { + Magnum::Error() << "Audio::Context::tryCreateContext(): spcifying attributes is not supported with emscripten."; + return false; + } + _context = alcCreateContext(_device, nullptr); +#endif return !!_context; }