Saved preferences override command line options

• May 4, 2018 - 07:56
Reported version
S4 - Minor

Encountered when trying to set MP3 export bitrate using "-b" on command line. I tried "-b 64", "-b 64000", "-b 64k", "-b 64kbps" etc. See .

lasconic commented on May 4, 2018 - 08:47,

"The preferences are initialiized with saved values AFTER the parsing of command line options... It doesn't work. Can someone file a bug ?"


Reported version 2.2 2.1

Affected by the -b option are MuseScore version 2.1 -2.2.1 (the option didn't exist before 2.1, got added with #50926: Allow setting preferences for the quality and bitrate of mp3 produced by MuseScore)
Other options needs to get checked whether they also are affected.
-b takes a number and interprets this as kbps, I don't think the conversion works if using any postfix like k or kbps, and 64000 won't work either, such high bitrates are not supported.

Code in master is different, as far as I read it there a temp override is used instead of modifying the preferences (which is what should happen in 2.x too). Needs more checking though

Similar issue with PNG resolution, resolved differently, not to overwrite from (and to) preferences. But no real input check there.
And in master both are set only in memory and as such not saved in the preferences. Whether this really works or also gets overwritten by existing preferences remains to be checked.

Status (old) patch (code needs review) fixed
Status fixed

Fixed in branch master, commit 7879427c77

Fix #272042: saved preferences override command line options

For master, here at least do the input check and update the usage