celluloid-player / celluloid

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

volume=xx in celluloid.conf is ignored. #677

Open D33M0N opened 3 years ago

D33M0N commented 3 years ago

Celluloid 0.21

can't set anywhere default volume. celluloid --volume=20 filename.mkv results in: Unknown option --volume=20

celluloid --mpv-volume=20 filename.mkv doesn't give this unknown option error, but doesn't do anything either and the file plays at whatever volume you played your last file before it.

in celluloid.conf file neither volume=20 nor mpv-volume=20 do nothing at all and every new file starts with whatever volume you played your previous video.

gnome-mpv commented 3 years ago

I can't reproduce this.

Can you post the output of G_MESSAGES_DEBUG=all celluloid --mpv-volume=20 --mpv-msg-level=all=trace filename.mkv?

D33M0N commented 3 years ago

debug_stuff.txt

This is now then previously opened file thing, where I assume it did save with the position when quitted also volume info?? And then it seems to ignore the command line option.

Anyway, weirdly enough when opening a NEW file (like, mv file.mkv file2.mkv; and then celluloid --mpv-volume=20 file2.mkv) with command line option --mpv-volume=20 seems to actually work now (starting volume was 20%). However the config file settings (in the file ~/.config/celluloid/celluloid.conf which is also set as the config file in celluloid settings->preferences->config files->Load mpv configuration file: ):

#
reset-on-next-file=all
volume=20
mpv-volume=20

are still completely ignored, when I try to launch the new (renamed with new name) file with just celluloid newfile.mkv.

gnome-mpv commented 3 years ago

Okay, I think I understand what you mean now.

This is now then previously opened file thing, where I assume it did save with the position when quitted also volume info?? And then it seems to ignore the command line option.

I think what happened is that the volume is initially set to 20 but then immediately gets overwritten by the saved volume. This is a bit tricky to fix because there's no way to differentiate between 1) the user opening a file from a file manager and 2) the user launching Celluloid and then open a file. In GNOME, 1) is handled by launching Celluloid and then sending a command via DBus for it to open the file, so from Celluloid's point of view 1) is the same as 2).

However the config file settings (in the file ~/.config/celluloid/celluloid.conf which is also set as the config file in celluloid settings->preferences->config files->Load mpv configuration file: ): are still completely ignored

The volume set in the config file is being overwritten here. We need to prevent the saved volume from being restored in this case, but the problem is there's no reliable way to figure out if an option is being set from the config file AFAIK.