History

options: remove deprecated auto choice for --mute

Since 995c47da9afacfcc30d8a17d2f2a2268fbf4fdb9, setting --mute=auto has been equivalent to --mute=no. It was formally documented later in 79e20ff485db4ee82e7b475a5329bf303570cde6. This is an old legacy relic and the auto choice popping up during auto completion could be confusing to users who aren't aware of the history. Remove it for good and convert the option to a proper boolean.

Dudemanguy committed 2 years ago

Commit 23ecfa91 parent bab9b2c4 files · +4 −10Browse files

Unified · Split

4 files
  1. DOCS/man/options.rst +1 −3
  2. options/options.c +1 −5
  3. options/options.h +1 −1
  4. player/audio.c +1 −1
DOCS/man/options.rst+1−3
@@ -2052,11 +2052,9 @@ Audio · 2051 unmodified lines
20522052 Audio delay in seconds (positive or negative float value). Positive values
20532053 delay the audio, and negative values delay the video.
20542054
2055−``--mute=<yes|no|auto>``
2055+``--mute=<yes|no>``
20562056 Set startup audio mute status (default: no).
20572057
2058− ``auto`` is a deprecated possible value that is equivalent to ``no``.
2059−
20602058 See also: ``--volume``.
20612059
20622060 ``--audio-demuxer=<[+]name>``
options/options.c+1−5
@@ -737,11 +737,7 @@ static const m_option_t mp_opts[] = { · 736 unmodified lines
737737 {"volume-gain-min", OPT_FLOAT(softvol_gain_min), M_RANGE(-150, 0)},
738738 {"volume-gain", OPT_FLOAT(softvol_gain), .flags = UPDATE_VOL,
739739 M_RANGE(-150, 150)},
740− {"mute", OPT_CHOICE(softvol_mute,
741− {"no", 0},
742− {"auto", 0},
743− {"yes", 1}),
744− .flags = UPDATE_VOL},
740+ {"mute", OPT_BOOL(softvol_mute), .flags = UPDATE_VOL},
745741 {"replaygain", OPT_CHOICE(rgain_mode,
746742 {"no", 0},
747743 {"track", 1},
options/options.h+1−1
@@ -189,7 +189,7 @@ typedef struct MPOpts { · 188 unmodified lines
189189 float rgain_preamp; // Set replaygain pre-amplification
190190 bool rgain_clip; // Enable/disable clipping prevention
191191 float rgain_fallback;
192− int softvol_mute;
192+ bool softvol_mute;
193193 float softvol_max;
194194 float softvol_gain;
195195 float softvol_gain_min;
player/audio.c+1−1
@@ -176,7 +176,7 @@ void audio_update_volume(struct MPContext *mpctx) · 175 unmodified lines
176176 gain = pow(gain, 3);
177177 gain *= compute_replaygain(mpctx);
178178 gain *= db_gain(opts->softvol_gain);
179− if (opts->softvol_mute == 1)
179+ if (opts->softvol_mute)
180180 gain = 0.0;
181181
182182 ao_set_gain(ao_c->ao, gain);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t