summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy White <jwhite@codeweavers.com>2016-09-28 09:17:51 -0500
committerJeremy White <jwhite@codeweavers.com>2016-10-03 09:38:52 -0500
commit9468cf2a9b7c6a5f4a91429bdd1d1ffbf4b99417 (patch)
tree305c1dfa2c9053229e1a5c30ecf00e0f812e84b0
parent3633675e4b4f202773eceec69c5a43158a93b37d (diff)
Implement support for the playback stop message.
This allows audio processing to be more robust in Firefox.
-rw-r--r--playback.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/playback.js b/playback.js
index 55dc0e8..48d4cdd 100644
--- a/playback.js
+++ b/playback.js
@@ -158,7 +158,22 @@ SpicePlaybackConn.prototype.process_channel_message = function(msg)
if (msg.type == SPICE_MSG_PLAYBACK_STOP)
{
- return true;
+ PLAYBACK_DEBUG > 0 && console.log("PlaybackStop");
+ if (this.source_buffer)
+ {
+ document.getElementById(this.parent.screen_id).removeChild(this.audio);
+ window.URL.revokeObjectURL(this.audio.src);
+
+ delete this.source_buffer;
+ delete this.media_source;
+ delete this.audio;
+
+ this.append_okay = false;
+ this.queue = new Array();
+ this.start_time = 0;
+
+ return true;
+ }
}
if (msg.type == SPICE_MSG_PLAYBACK_VOLUME)