mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Add --require-audio
By default, scrcpy mirrors only the video when audio capture fails on the device. Add a flag to force scrcpy to fail if audio is enabled but does not work. PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
This commit is contained in:
parent
81fb51e625
commit
fd0a82ba93
9 changed files with 47 additions and 15 deletions
|
|
@ -69,6 +69,7 @@ enum {
|
|||
OPT_AUDIO_ENCODER,
|
||||
OPT_LIST_ENCODERS,
|
||||
OPT_LIST_DISPLAYS,
|
||||
OPT_REQUIRE_AUDIO,
|
||||
};
|
||||
|
||||
struct sc_option {
|
||||
|
|
@ -458,6 +459,13 @@ static const struct sc_option options[] = {
|
|||
.longopt_id = OPT_RENDER_EXPIRED_FRAMES,
|
||||
.longopt = "render-expired-frames",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_REQUIRE_AUDIO,
|
||||
.longopt = "require-audio",
|
||||
.text = "By default, scrcpy mirrors only the video when audio capture "
|
||||
"fails on the device. This flag makes scrcpy fail if audio is "
|
||||
"enabled but does not work."
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_ROTATION,
|
||||
.longopt = "rotation",
|
||||
|
|
@ -1801,6 +1809,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||
case OPT_LIST_DISPLAYS:
|
||||
opts->list_displays = true;
|
||||
break;
|
||||
case OPT_REQUIRE_AUDIO:
|
||||
opts->require_audio = true;
|
||||
break;
|
||||
default:
|
||||
// getopt prints the error message on stderr
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue