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)