Fix saving replay buffer when no hotkey is set

This commit makes saving the replay buffer not rely on whether or not a
hotkey is set in OBS.
This commit is contained in:
Ryan Foster 2017-10-19 04:04:40 -04:00
parent 191cfa08d5
commit 1d44d3a109

View File

@ -780,13 +780,15 @@ void WSRequestHandler::HandleSaveReplayBuffer(WSRequestHandler* req) {
return;
}
obs_hotkey_t* hk = Utils::FindHotkeyByName("ReplayBuffer.Save");
if (hk) {
obs_hotkey_trigger_routed_callback(obs_hotkey_get_id(hk), true);
req->SendOKResponse();
} else {
req->SendErrorResponse("failed to save replay buffer");
}
calldata_t cd = {0};
obs_output_t* replay_output = obs_frontend_get_replay_buffer_output();
proc_handler_t* ph = obs_output_get_proc_handler(replay_output);
proc_handler_call(ph, "save", &cd);
req->SendOKResponse();
calldata_free(&cd);
obs_output_release(replay_output);
}
/**