Fix potential cause for playlist timer problem

This commit is contained in:
calzoneman 2015-01-22 16:53:36 -06:00
parent 7d2015620a
commit 5cde74cbd4

View file

@ -1049,7 +1049,12 @@ PlaylistModule.prototype.startPlayback = function (time) {
self.channel.notifyModules("onMediaChange", [self.current.media]);
/* Only start the timer if the media item is not live, i.e. has a duration */
if (media.seconds > 0) {
/*
* 2015-01-22: Don't start the timer if there is an active leader or if
* the timer is already running. Both are possible since checkModules()
* is asynchronous
*/
if (media.seconds > 0 && !self.leader && !self._leadInterval) {
self._lastUpdate = Date.now();
self._leadInterval = setInterval(function() {
self._leadLoop();