Skip to content

Commit 8b8582c

Browse files
committed
make args incompatible
1 parent 0dfb506 commit 8b8582c

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
@@ -3065,6 +3065,13 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
30653065
}
30663066
}
30673067

3068+
if (opts->client_audio_source &&
3069+
(opts->audio_source == SC_AUDIO_SOURCE_VOICE_CALL ||
3070+
opts->audio_source == SC_AUDIO_SOURCE_VOICE_CALL_UPLINK)) {
3071+
LOGE("--client-audio-source is incompatible with --audio-source=voice-call and --audio-source=voice-call-uplink");
3072+
return false;
3073+
}
3074+
30683075
if (otg) {
30693076
if (!opts->control) {
30703077
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
@@ -550,6 +550,12 @@ public static Options parse(String... args) {
550550
options.displayId = Device.DISPLAY_ID_NONE;
551551
}
552552

553+
if (options.client_audio &&
554+
(options.audioSource == AudioSource.VOICE_CALL ||
555+
options.audioSource == AudioSource.VOICE_CALL_UPLINK)) {
556+
throw new IllegalArgumentException("client_audio is incompatible with audio_source=voice-call and audio_source=voice-call-uplink");
557+
}
558+
553559
return options;
554560
}
555561

0 commit comments

Comments
 (0)