From 430e61bef74841a0f783bf457c68b536a9e32229 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 27 Dec 2021 18:26:38 -0800 Subject: [PATCH] RequestHandler: Use ValidateScene2 in ValidateSceneItem --- src/requesthandler/rpc/Request.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/requesthandler/rpc/Request.cpp b/src/requesthandler/rpc/Request.cpp index 669a7954..418268e3 100644 --- a/src/requesthandler/rpc/Request.cpp +++ b/src/requesthandler/rpc/Request.cpp @@ -297,22 +297,12 @@ obs_source_t *Request::ValidateInput(const std::string &keyName, RequestStatus:: obs_sceneitem_t *Request::ValidateSceneItem(const std::string &sceneKeyName, const std::string &sceneItemIdKeyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const ObsWebSocketSceneFilter filter) const { - OBSSourceAutoRelease sceneSource = ValidateScene(sceneKeyName, statusCode, comment, filter); - if (!sceneSource) + OBSSceneAutoRelease scene = ValidateScene2(sceneKeyName, statusCode, comment, filter); + if (!scene) return nullptr; if (!ValidateNumber(sceneItemIdKeyName, statusCode, comment, 0)) return nullptr; - - OBSScene scene = obs_scene_from_source(sceneSource); - if (!scene) { - scene = obs_group_from_source(sceneSource); - if (!scene) { // This should never happen - statusCode = RequestStatus::GenericError; - comment = "Somehow the scene was found but the scene object could not be fetched. Please report this to the obs-websocket developers."; - return nullptr; - } - } int64_t sceneItemId = RequestData[sceneItemIdKeyName];