Skip to content

Commit

Permalink
fix self.set_volume() method call
Browse files Browse the repository at this point in the history
  • Loading branch information
mokurin000 authored Jan 22, 2024
1 parent b0024e7 commit e35ec1a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions feeluown/player/mpvplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,14 @@ def set_volume(self, max_volume: int, fade_in: bool):

def fade_in(self):
with self.fade_lock:
max_volume = self.volume
# skip fade-in on playing
if not self._mpv.pause:
return

max_volume = self.volume

self._resume()
set_volume(max_volume, fade_in=True)
self.set_volume(max_volume, fade_in=True)

def fade_out(self):
with self.fade_lock:
Expand All @@ -201,7 +202,7 @@ def fade_out(self):
max_volume = self.volume
self.pausing = True

set_volume(max_volume, fade_in=False)
self.set_volume(max_volume, fade_in=False)
self._pause()

self.pausing = False
Expand Down Expand Up @@ -345,4 +346,3 @@ def fade_curve(k: float, fade_in: bool) -> float:
return (1-math.cos(k*math.pi)) / 2
else:
return (1+math.cos(k*math.pi)) / 2

0 comments on commit e35ec1a

Please sign in to comment.