From a9d5d8d0057628e4e749590fb708d786adf979ed Mon Sep 17 00:00:00 2001 From: simpleTechs Date: Fri, 6 Jun 2014 16:31:02 +0200 Subject: [PATCH 1/2] Fixed a bug that would cause multiple instreams to fail When the event handler is removed on stop, it is not correctly re-added on start (only if _timer was not set at all). This causes multiple inStreams to fail, i.e. the first one would play just fine, but after that the time would never execute the "onTimer" method; thus no other inStream would ever play. --- .../actionscript/org/flowplayer/controller/InStreamTracker.as | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as b/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as index cdfee19..b4b801f 100644 --- a/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as +++ b/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as @@ -64,7 +64,6 @@ package org.flowplayer.controller { log.debug("stop()"); if (_timer && _timer.running) { _timer.stop(); - _timer.removeEventListener(TimerEvent.TIMER, onTimer); } } @@ -90,4 +89,4 @@ package org.flowplayer.controller { } } -} \ No newline at end of file +} From cab8cee758366c12b63d485ebcc6c9bb9526c78d Mon Sep 17 00:00:00 2001 From: simpleTechs Date: Sat, 7 Jun 2014 11:21:03 +0200 Subject: [PATCH 2/2] Re-introduced cleanup of the timer after usage As per danrossi's requests, this re-introduces cleaning up the timer in stop and actually set's it to `null`, so that it's recreated in `start()`, with the appropriate event handler set up. --- .../actionscript/org/flowplayer/controller/InStreamTracker.as | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as b/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as index b4b801f..78e3741 100644 --- a/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as +++ b/core/src/actionscript/org/flowplayer/controller/InStreamTracker.as @@ -64,7 +64,9 @@ package org.flowplayer.controller { log.debug("stop()"); if (_timer && _timer.running) { _timer.stop(); + _timer.removeEventListener(TimerEvent.TIMER, onTimer); } + _timer = null; } private function onTimer(event:TimerEvent):void {