Do not fail if SDL_INIT_VIDEO fails without video
The SDL video subsystem may be initialized so that clipboard synchronization works even without video playback. But if the video subsystem initialization fails (e.g. because no video device is available), consider it as an error only if video playback is enabled. Refs 5e59ed31352251791679e5931d7e5abf0c2d18f6 Fixes #4477 <https://github.com/Genymobile/scrcpy/issues/4477>
This commit is contained in:
parent
bf056b1fee
commit
9497f39fb4
@ -426,8 +426,13 @@ scrcpy(struct scrcpy_options *options) {
|
||||
// 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 it fails, it is an error only if video playback is enabled
|
||||
if (options->video_playback) {
|
||||
LOGE("Could not initialize SDL video: %s", SDL_GetError());
|
||||
goto end;
|
||||
} else {
|
||||
LOGW("Could not initialize SDL video: %s", SDL_GetError());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user