Browse Source

Remove the default source type (resolves #1082)

--HG--
branch : minor
Bart van Strien 9 years ago
parent
commit
dc7b1fb049

+ 1 - 1
src/modules/audio/wrap_Audio.cpp

@@ -49,7 +49,7 @@ int w_newSource(lua_State *L)
 
 
 	Source::Type stype = Source::TYPE_STREAM;
 	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))
 	if (stypestr && !Source::getConstant(stypestr, stype))
 		return luaL_error(L, "Invalid source type: %s", stypestr);
 		return luaL_error(L, "Invalid source type: %s", stypestr);
 
 

+ 1 - 1
src/modules/graphics/opengl/wrap_Graphics.lua

@@ -359,7 +359,7 @@ function love.graphics.newVideo(file, loadaudio)
 	local source, success
 	local source, success
 
 
 	if loadaudio ~= false then
 	if loadaudio ~= false then
-		success, source = pcall(love.audio.newSource, video:getStream():getFilename())
+		success, source = pcall(love.audio.newSource, video:getStream():getFilename(), "stream")
 	end
 	end
 	if success then
 	if success then
 		video:setSource(source)
 		video:setSource(source)