mirror of
https://github.com/Genymobile/scrcpy
synced 2025-01-23 16:25:14 +00:00
Set SDL hints before creating any thread
To avoid race conditions in SDL (reported by TSAN).
This commit is contained in:
parent
fd0f432e87
commit
4dca08cfe3
@ -409,6 +409,12 @@ scrcpy(struct scrcpy_options *options) {
|
||||
return SCRCPY_EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (options->video_playback) {
|
||||
// Set hints before starting the server thread to avoid race conditions
|
||||
// in SDL
|
||||
sdl_set_hints(options->render_driver);
|
||||
}
|
||||
|
||||
if (!sc_server_start(&s->server)) {
|
||||
goto end;
|
||||
}
|
||||
@ -425,10 +431,6 @@ scrcpy(struct scrcpy_options *options) {
|
||||
assert(!options->video_playback || options->video);
|
||||
assert(!options->audio_playback || options->audio);
|
||||
|
||||
if (options->video_playback) {
|
||||
sdl_set_hints(options->render_driver);
|
||||
}
|
||||
|
||||
if (options->video_playback ||
|
||||
(options->control && options->clipboard_autosync)) {
|
||||
// Initialize the video subsystem even if --no-video or
|
||||
|
Loading…
Reference in New Issue
Block a user