mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 13:34:20 +01:00
Switch audio source if audio-dup is set
Automatically switch implicit audio source to "playback" if --audio-dup
is passed.
This allows to run:
scrcpy --audio-dup
without specifying explicitly:
scrcpy --audio-source=playback --audio-dup
PR #5102 <https://github.com/Genymobile/scrcpy/pull/5102>
This commit is contained in:
@@ -2895,7 +2895,13 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
if (opts->audio && opts->audio_source == SC_AUDIO_SOURCE_AUTO) {
|
if (opts->audio && opts->audio_source == SC_AUDIO_SOURCE_AUTO) {
|
||||||
// Select the audio source according to the video source
|
// Select the audio source according to the video source
|
||||||
if (opts->video_source == SC_VIDEO_SOURCE_DISPLAY) {
|
if (opts->video_source == SC_VIDEO_SOURCE_DISPLAY) {
|
||||||
|
if (opts->audio_dup) {
|
||||||
|
LOGI("Audio duplication enabled: audio source switched to "
|
||||||
|
"\"playback\"");
|
||||||
|
opts->audio_source = SC_AUDIO_SOURCE_PLAYBACK;
|
||||||
|
} else {
|
||||||
opts->audio_source = SC_AUDIO_SOURCE_OUTPUT;
|
opts->audio_source = SC_AUDIO_SOURCE_OUTPUT;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
opts->audio_source = SC_AUDIO_SOURCE_MIC;
|
opts->audio_source = SC_AUDIO_SOURCE_MIC;
|
||||||
LOGI("Camera video source: microphone audio source selected");
|
LOGI("Camera video source: microphone audio source selected");
|
||||||
|
|||||||
Reference in New Issue
Block a user