mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user