Skip to content

Commit cdc664b

Browse files
committed
make args incompatible
1 parent 47a5685 commit cdc664b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

app/src/cli.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,6 +3030,13 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
30303030
}
30313031
}
30323032

3033+
if (opts->client_audio_source &&
3034+
(opts->audio_source == SC_AUDIO_SOURCE_VOICE_CALL ||
3035+
opts->audio_source == SC_AUDIO_SOURCE_VOICE_CALL_UPLINK)) {
3036+
LOGE("--client-audio-source is incompatible with --audio-source=voice-call and --audio-source=voice-call-uplink");
3037+
return false;
3038+
}
3039+
30333040
if (otg) {
30343041
if (!opts->control) {
30353042
LOGE("--no-control is not allowed in OTG mode");

server/src/main/java/com/genymobile/scrcpy/Options.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ public static Options parse(String... args) {
532532
options.displayId = Device.DISPLAY_ID_NONE;
533533
}
534534

535+
if (options.client_audio &&
536+
(options.audioSource == AudioSource.VOICE_CALL ||
537+
options.audioSource == AudioSource.VOICE_CALL_UPLINK)) {
538+
throw new IllegalArgumentException("client_audio is incompatible with audio_source=voice-call and audio_source=voice-call-uplink");
539+
}
540+
535541
return options;
536542
}
537543

0 commit comments

Comments
 (0)