Compare commits

...

2 Commits

Author SHA1 Message Date
Romain Vimont 9aa6cc71be Forbid --no-control in OTG mode
The whole purpose of OTG is to only control the device.
1 month ago
Romain Vimont 54e08b4eae Fix code style
Limit to 80 columns.
1 month ago

@ -2556,9 +2556,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
if (opts->audio_playback && opts->audio_buffer == -1) { if (opts->audio_playback && opts->audio_buffer == -1) {
if (opts->audio_codec == SC_CODEC_FLAC) { if (opts->audio_codec == SC_CODEC_FLAC) {
// Use 50 ms audio buffer by default, but use a higher value for FLAC, // Use 50 ms audio buffer by default, but use a higher value for
// which is not low latency (the default encoder produces blocks of // FLAC, which is not low latency (the default encoder produces
// 4096 samples, which represent ~85.333ms). // blocks of 4096 samples, which represent ~85.333ms).
LOGI("FLAC audio: audio buffer increased to 120 ms (use " LOGI("FLAC audio: audio buffer increased to 120 ms (use "
"--audio-buffer to set a custom value)"); "--audio-buffer to set a custom value)");
opts->audio_buffer = SC_TICK_FROM_MS(120); opts->audio_buffer = SC_TICK_FROM_MS(120);
@ -2598,6 +2598,11 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
} }
if (otg) { if (otg) {
if (!opts->control) {
LOGE("--no-control is not allowed in OTG mode");
return false;
}
enum sc_keyboard_input_mode kmode = opts->keyboard_input_mode; enum sc_keyboard_input_mode kmode = opts->keyboard_input_mode;
if (kmode != SC_KEYBOARD_INPUT_MODE_AOA if (kmode != SC_KEYBOARD_INPUT_MODE_AOA
&& kmode != SC_KEYBOARD_INPUT_MODE_DISABLED) { && kmode != SC_KEYBOARD_INPUT_MODE_DISABLED) {

Loading…
Cancel
Save