From 5cde74cbd40cbf5ca4d114e394249a6ad1b9bb41 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 22 Jan 2015 16:53:36 -0600 Subject: [PATCH] Fix potential cause for playlist timer problem --- lib/channel/playlist.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/channel/playlist.js b/lib/channel/playlist.js index 30ec0944..f414576a 100644 --- a/lib/channel/playlist.js +++ b/lib/channel/playlist.js @@ -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();