u8sand / Baka-MPlayer

The libmpv based media player
https://u8sand.github.io/Baka-MPlayer/
GNU General Public License v2.0
433 stars 93 forks source link

Feature Request: Default volume on startup #217

Closed yash1610 closed 7 years ago

yash1610 commented 8 years ago

Currently whenever the program starts the volume is set at 100, if you open a file using your file-manager sure enough the program starts at 100% volume deafening me and waking up everyone in the house. I couldn't find an obvious way to change the default volume on startup. Tried putting 'volume': 30, in ~/.config/bakamplayer.ini but that doesn't seem to work, it still starts at full volume.

ErikDavison commented 8 years ago

Getting the same problem. The .ini file seems to be getting read in and updated fine so I don't think its that. I've done a little debugging so far, and I've found that mpv's volume gets updated twice at startup: 1st, to the correct value in .ini, and then again, to 100. I'll try and pin down where this 2nd event is coming from.

EDIT: Seems to be related to this issue in the mpv (https://github.com/mpv-player/mpv/issues/2920) I'll try to update my mpv and see what changes

ErikDavison commented 8 years ago

After a little more digging I found that the 2nd event was coming after mpv was initialized. I found that mpvhandler's volume was being loaded by the .ini, however this never got reflected in the actual mpv instance. Thus after initialization mpv was loading a default value of 100.

The patch I've submitted ensures mpvhandler's volume is registered with mpv when there is no playback (such as before initialization).