mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 18:29:45 +02:00
Disable gapless playback via runtime flag (#444)
* Enable gapless playback via runtime flag * Set gapless playback as default, use `--disable-gapless` to turn it off * Ensure sink restarts b/w tracks when gapless is disabled
This commit is contained in:
parent
66f8a98ad2
commit
ef27b4bce3
3 changed files with 11 additions and 1 deletions
|
@ -180,6 +180,11 @@ fn setup(args: &[String]) -> Setup {
|
|||
"",
|
||||
"autoplay",
|
||||
"autoplay similar songs when your music ends.",
|
||||
)
|
||||
.optflag(
|
||||
"",
|
||||
"disable-gapless",
|
||||
"disable gapless playback.",
|
||||
);
|
||||
|
||||
let matches = match opts.parse(&args[1..]) {
|
||||
|
@ -312,9 +317,9 @@ fn setup(args: &[String]) -> Setup {
|
|||
.as_ref()
|
||||
.map(|bitrate| Bitrate::from_str(bitrate).expect("Invalid bitrate"))
|
||||
.unwrap_or(Bitrate::default());
|
||||
|
||||
PlayerConfig {
|
||||
bitrate: bitrate,
|
||||
gapless: !matches.opt_present("disable-gapless"),
|
||||
normalisation: matches.opt_present("enable-volume-normalisation"),
|
||||
normalisation_pregain: matches
|
||||
.opt_str("normalisation-pregain")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue