Add --no-kill-adb-before-otg option

Add an option not to kill the adb daemon on Windows if --otg is
specified.

Refs #4028 <https://github.com/Genymobile/scrcpy/issues/4028>
PR #4035 <https://github.com/Genymobile/scrcpy/pull/4035>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
Self Not Found
2023-06-01 21:10:06 +02:00
committed by Romain Vimont
parent fc52b24503
commit fbeb53009a
4 changed files with 31 additions and 4 deletions

View File

@@ -83,10 +83,12 @@ scrcpy_otg(struct scrcpy_options *options) {
#ifdef _WIN32
// On Windows, only one process could open a USB device
// <https://github.com/Genymobile/scrcpy/issues/2773>
LOGI("Killing adb daemon (if any)...");
unsigned flags = SC_ADB_NO_STDOUT | SC_ADB_NO_STDERR | SC_ADB_NO_LOGERR;
// uninterruptible (intr == NULL), but in practice it's very quick
sc_adb_kill_server(NULL, flags);
if (options->kill_adb_before_otg) {
LOGI("Killing adb daemon (if any)...");
unsigned flags = SC_ADB_NO_STDOUT | SC_ADB_NO_STDERR | SC_ADB_NO_LOGERR;
// uninterruptible (intr == NULL), but in practice it's very quick
sc_adb_kill_server(NULL, flags);
}
#endif
static const struct sc_usb_callbacks cbs = {