Skip to content

Commit 680003b

Browse files
exeldroRytoEX
authored andcommitted
requesthandler: Fix AcquireSource without canvas
1 parent a3a6bfe commit 680003b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/requesthandler/rpc/Request.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ obs_source_t *Request::AcquireSource(const std::string &canvasUuidKeyName, const
248248
if (!canvas)
249249
return nullptr;
250250
std::string sourceName = RequestData[nameKeyName];
251-
obs_source_t *ret = obs_canvas_get_source_by_name(canvas, sourceName.c_str());
251+
obs_source_t *ret = (obs_canvas_get_flags(canvas) & MAIN)
252+
? obs_get_source_by_name(sourceName.c_str())
253+
: obs_canvas_get_source_by_name(canvas, sourceName.c_str());
252254
if (!ret) {
253255
statusCode = RequestStatus::ResourceNotFound;
254256
comment = std::string("No source was found by the name of `") + sourceName + "` within the canvas `" +

0 commit comments

Comments
 (0)