diff --git a/light9/ascoltami/player.py b/light9/ascoltami/player.py --- a/light9/ascoltami/player.py +++ b/light9/ascoltami/player.py @@ -35,10 +35,9 @@ class Player(object): #self.watchForMessages(bus) def watchTime(self): - - self.pollForMessages() - try: + self.pollForMessages() + t = self.currentTime() log.debug("watch %s < %s < %s", self.lastWatchTime, self.autoStopTime, t) @@ -161,6 +160,8 @@ class Player(object): def setupAutostop(self): dur = self.duration() + if dur == 0: + raise ValueError("duration=0, can't set autostop") self.autoStopTime = (dur - self.autoStopOffset) log.info("autostop will be at %s", self.autoStopTime) # pipeline.seek can take a stop time, but using that wasn't diff --git a/makefile b/makefile --- a/makefile +++ b/makefile @@ -49,4 +49,4 @@ tkdnd_build: bin/ascoltami2: gst_packages link_to_sys_packages gst_packages: - sudo aptitude install python-gi gir1.2-gst-plugins-base-1.0 libgirepository-1.0-1 gir1.2-gstreamer-1.0 gstreamer1.0-tools gstreamer1.0-plugins-good + sudo aptitude install python-gi gir1.2-gst-plugins-base-1.0 libgirepository-1.0-1 gir1.2-gstreamer-1.0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-pulseaudio