celluloid-player / celluloid

A simple GTK+ frontend for mpv
https://celluloid-player.github.io
GNU General Public License v3.0
1.09k stars 88 forks source link

Override stored volume #923

Open p3lim opened 5 months ago

p3lim commented 5 months ago

Overview Description:

The --volume nor --mpv-volume commandline options or configuration options seem to work, the "stored" volume always take precedence.

Steps to Reproduce:

  1. Enable mpv.conf in settings
  2. Set volume=10 in mpv.conf
  3. Play a video

Actual Results: Volume setting is ignored.

Expected Results: Celluloid should respect the mpv.conf volume setting (or CLI option).

Version: 0.20

Additional Information: Mentioned in https://github.com/celluloid-player/celluloid/issues/477#issuecomment-545994429 an option to ignore the stored volume was suggested, but dismissed by the issuer. I would really like to see this setting, as I always want to have a specific volume set whenever Celluloid is started (but not reset between files in a playlist!).

p3lim commented 5 months ago

Temporary workaround in a script:

local config = os.getenv('HOME') .. '/.config/mpv/mpv.conf'
local fh = io.open(config, 'r')
if fh then
  fh.close()

  for line in io.lines(config) do
    local volume = line:match('^volume%s*=%s*(%d+)$')
    if volume then
      mp.set_property('volume', volume)
      break
    end
  end
end