0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

mac-capture: Remove disp_finished event

This event is only used within destroy_[audio]_screen_stream, and does
not appear to be necessary there. stopCaptureWithCompletionHandler holds
a reference to the SCStream object by itself (and the other objects
being held aren't used afterwards anyways), so there should be no harm
in releasing everything immediately without blocking.
This commit is contained in:
gxalpha 2024-08-13 17:09:11 +02:00 committed by Matt Gajownik
parent 60a45d3aa3
commit 92d5b45a50
3 changed files with 0 additions and 13 deletions

View File

@ -13,9 +13,7 @@ API_AVAILABLE(macos(13.0)) static void destroy_audio_screen_stream(struct screen
MACCAP_ERR("destroy_audio_screen_stream: Failed to stop stream with error %s\n",
[[error localizedFailureReason] cStringUsingEncoding:NSUTF8StringEncoding]);
}
os_event_signal(sc->disp_finished);
}];
os_event_wait(sc->disp_finished);
}
if (sc->stream_properties) {
@ -28,7 +26,6 @@ API_AVAILABLE(macos(13.0)) static void destroy_audio_screen_stream(struct screen
sc->disp = NULL;
}
os_event_destroy(sc->disp_finished);
os_event_destroy(sc->stream_start_completed);
}
@ -152,7 +149,6 @@ API_AVAILABLE(macos(13.0)) static bool init_audio_screen_stream(struct screen_ca
sc->disp = NULL;
return !did_add_output;
}
os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL);
os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL);
__block BOOL did_stream_start = false;

View File

@ -52,7 +52,6 @@ struct API_AVAILABLE(macos(12.5)) screen_capture {
SCShareableContent *shareable_content;
ScreenCaptureDelegate *capture_delegate;
os_event_t *disp_finished;
os_event_t *stream_start_completed;
os_sem_t *shareable_content_available;
IOSurfaceRef current, prev;

View File

@ -9,9 +9,7 @@ API_AVAILABLE(macos(12.5)) static void destroy_screen_stream(struct screen_captu
MACCAP_ERR("destroy_screen_stream: Failed to stop stream with error %s\n",
[[error localizedFailureReason] cStringUsingEncoding:NSUTF8StringEncoding]);
}
os_event_signal(sc->disp_finished);
}];
os_event_wait(sc->disp_finished);
}
if (sc->stream_properties) {
@ -41,7 +39,6 @@ API_AVAILABLE(macos(12.5)) static void destroy_screen_stream(struct screen_captu
sc->disp = NULL;
}
os_event_destroy(sc->disp_finished);
os_event_destroy(sc->stream_start_completed);
}
@ -110,7 +107,6 @@ API_AVAILABLE(macos(12.5)) static bool init_screen_stream(struct screen_capture
MACCAP_ERR("init_screen_stream: Invalid target display ID: %u\n", sc->display);
os_sem_post(sc->shareable_content_available);
sc->disp = NULL;
os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL);
os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL);
return true;
}
@ -152,7 +148,6 @@ API_AVAILABLE(macos(12.5)) static bool init_screen_stream(struct screen_capture
MACCAP_ERR("init_screen_stream: Invalid target window ID: %u\n", sc->window);
os_sem_post(sc->shareable_content_available);
sc->disp = NULL;
os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL);
os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL);
return true;
} else {
@ -172,7 +167,6 @@ API_AVAILABLE(macos(12.5)) static bool init_screen_stream(struct screen_capture
MACCAP_ERR("init_screen_stream: Invalid target display ID: %u\n", sc->display);
os_sem_post(sc->shareable_content_available);
sc->disp = NULL;
os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL);
os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL);
return true;
}
@ -217,7 +211,6 @@ API_AVAILABLE(macos(12.5)) static bool init_screen_stream(struct screen_capture
if (sc->capture_type != ScreenCaptureWindowStream) {
sc->disp = NULL;
[content_filter release];
os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL);
os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL);
return true;
}
@ -250,7 +243,6 @@ API_AVAILABLE(macos(12.5)) static bool init_screen_stream(struct screen_capture
return !did_add_output;
}
}
os_event_init(&sc->disp_finished, OS_EVENT_TYPE_MANUAL);
os_event_init(&sc->stream_start_completed, OS_EVENT_TYPE_MANUAL);
__block BOOL did_stream_start = NO;