Add a log when auto stopping stream / record (#74)

* Add a log when auto stopping stream / record

I had a hard time deciphering why the stream stopped automatically for someone when using the plugin as the logs contained nothing indicating an error or an action from the plugin.
He activated the checkbox to auto stop stream when a scene is activated (which I didn't know) so the plugin was doing exactly what asked.
I think adding a log is a good idea for an action as important as stopping the stream.
I added the same for starting stream for the same reasons.
This commit is contained in:
Guillaume Turchini
2020-11-27 17:34:17 +01:00
committed by GitHub
parent 22a90c7d64
commit ba15e6812f

View File

@@ -158,10 +158,18 @@ void SwitcherData::autoStopStreamAndRecording()
obs_weak_source_t *ws = obs_source_get_weak_source(currentSource);
if (ws && autoStopScene == ws) {
if (obs_frontend_streaming_active())
if (obs_frontend_streaming_active()) {
blog(LOG_INFO,
"Stopping stream because scene '%s' is active",
obs_source_get_name(currentSource));
obs_frontend_streaming_stop();
if (obs_frontend_recording_active())
}
if (obs_frontend_recording_active()) {
blog(LOG_INFO,
"Stopping record because scene '%s' is active",
obs_source_get_name(currentSource));
obs_frontend_recording_stop();
}
}
obs_source_release(currentSource);
obs_weak_source_release(ws);
@@ -226,12 +234,20 @@ void SwitcherData::autoStartStreamRecording()
if (ws && autoStartScene == ws) {
if ((switcher->autoStartType == STREAMING ||
switcher->autoStartType == RECORINDGSTREAMING) &&
!obs_frontend_streaming_active())
!obs_frontend_streaming_active()) {
blog(LOG_INFO,
"Starting stream because scene '%s' is active",
obs_source_get_name(currentSource));
obs_frontend_streaming_start();
}
if ((switcher->autoStartType == RECORDING ||
switcher->autoStartType == RECORINDGSTREAMING) &&
!obs_frontend_recording_active())
!obs_frontend_recording_active()) {
blog(LOG_INFO,
"Starting record because scene '%s' is active",
obs_source_get_name(currentSource));
obs_frontend_recording_start();
}
}
obs_source_release(currentSource);
obs_weak_source_release(ws);