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