Skip to content

Commit

Permalink
Always initialize SDL with the video subsystem
Browse files Browse the repository at this point in the history
Clipboard synchronization requires SDL_INIT_VIDEO, so always initialize
the video subsystem, even if --no-video or --no-video-playback is
passed.

Refs caf594c
Fixes #4418 <#4418>
  • Loading branch information
rom1v committed Nov 11, 2023
1 parent 4eb3305 commit 5e59ed3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/src/scrcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,14 @@ scrcpy(struct scrcpy_options *options) {

if (options->video_playback) {
sdl_set_hints(options->render_driver);
if (SDL_Init(SDL_INIT_VIDEO)) {
LOGE("Could not initialize SDL video: %s", SDL_GetError());
goto end;
}
}

// Initialize the video subsystem even if --no-video or --no-video-playback
// is passed so that clipboard synchronization still works.
// <https://github.com/Genymobile/scrcpy/issues/4418>
if (SDL_Init(SDL_INIT_VIDEO)) {
LOGE("Could not initialize SDL video: %s", SDL_GetError());
goto end;
}

if (options->audio_playback) {
Expand Down

0 comments on commit 5e59ed3

Please sign in to comment.