From dc7b1fb0497ea3cb9a3820c427504cd91bd2684a Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Tue, 8 Mar 2016 11:44:36 +0100 Subject: [PATCH] Remove the default source type (resolves #1082) --HG-- branch : minor --- src/modules/audio/wrap_Audio.cpp | 2 +- src/modules/graphics/opengl/wrap_Graphics.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/audio/wrap_Audio.cpp b/src/modules/audio/wrap_Audio.cpp index 0e617ff76..52abf3110 100644 --- a/src/modules/audio/wrap_Audio.cpp +++ b/src/modules/audio/wrap_Audio.cpp @@ -49,7 +49,7 @@ int w_newSource(lua_State *L) Source::Type stype = Source::TYPE_STREAM; - const char *stypestr = lua_isnoneornil(L, 2) ? 0 : lua_tostring(L, 2); + const char *stypestr = luaL_checkstring(L, 2); if (stypestr && !Source::getConstant(stypestr, stype)) return luaL_error(L, "Invalid source type: %s", stypestr); diff --git a/src/modules/graphics/opengl/wrap_Graphics.lua b/src/modules/graphics/opengl/wrap_Graphics.lua index b92cb40bb..8424807a0 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.lua +++ b/src/modules/graphics/opengl/wrap_Graphics.lua @@ -359,7 +359,7 @@ function love.graphics.newVideo(file, loadaudio) local source, success if loadaudio ~= false then - success, source = pcall(love.audio.newSource, video:getStream():getFilename()) + success, source = pcall(love.audio.newSource, video:getStream():getFilename(), "stream") end if success then video:setSource(source)