Skip to content

Commit

Permalink
perf: Load the recorder asynchronously (#18)
Browse files Browse the repository at this point in the history
Makes the application feel snappier when launching it (and removes the 2-3 second freeze).
  • Loading branch information
Segergren authored Aug 11, 2022
1 parent 2c5b2df commit b47b72c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Recorders/LibObsRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class LibObsRecorder : BaseRecorder {

static signal_callback_t outputStopCb;

public override void Start() {
public override async void Start() {
if (Connected) return;

// STARTUP
Expand Down
4 changes: 2 additions & 2 deletions Classes/Services/RecordingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Session(int _Pid, string _GameTitle, string _Exe=null) {
}
}

public static void Start(Type type) {
public async static void Start(Type type) {
DetectionService.LoadDetections();

if (ActiveRecorder == null) {
Expand All @@ -36,7 +36,7 @@ public static void Start(Type type) {
}

ActiveRecorder = new LibObsRecorder();
ActiveRecorder.Start();
await Task.Run(() => ActiveRecorder.Start());
}
}

Expand Down

0 comments on commit b47b72c

Please sign in to comment.