Commit Graph

11 Commits

Author SHA1 Message Date
Jeremy White
9468cf2a9b Implement support for the playback stop message.
This allows audio processing to be more robust in Firefox.
2016-10-03 09:38:52 -05:00
Jeremy White
3633675e4b Rely on the auto play attribute.
Browsers now reliably autoplay, and issuing play prematurely
can generate an error in both Firefox and Chrome.

Hence we can simply remove this call and audio seems to work fine.
2016-10-03 09:38:31 -05:00
Jeremy White
dc5fd91f0c Revise sound packet time sequencing for a more recent Firefox.
Around version 45, Firefox started being very particular about the
time stamps put into the Opus stream.  The time stamps from the Spice server are
somewhat irregular.  They mostly arrive every 10 ms, but sometimes it is 11, or sometimes
with two time stamps the same in a row.  The previous logic resulted in fuzzy and/or
distorted audio streams in Firefox in a row.

Thus, we end up with an inelegant hack.  Essentially, we force every packet to have
a 10ms time delta, unless there is an obvious gap in time stream, in which case we
will resync.

This replaces logic that mitigated only the duplicated time packets.

The long term solution would appear to be 'sequence' mode, but I cannot get
Firefox to use that mode (and MDN suggests that for codecs such as VP8 with time
stamps in line, that Firefox will not accept it).
2016-10-03 09:37:56 -05:00
Jeremy White
245a476bd9 Use modern browser information to detect underrun.
We previously had a fairly crude 'gap detection', but browsers
are largely supporting the modern buffer semantics, and we can
now rely on them to detect under runs for us.

This improves audio in Chrome while playing large videos.
2016-10-03 09:37:16 -05:00
Oliver Gutierrez
1f4959e3c2 Fixed trailing whitespaces in several files 2016-09-28 15:03:48 -05:00
Oliver Gutierrez
667f16c2a4 playback: Don't try to access undefined source buffer
The playback code first tries to access this.source_buffer and then
would check whether it's defined.

This was causing unwanted exception to be thrown in the cockpit
spice-html5 plugin.
2016-08-03 12:29:51 +02:00
Jeremy White
5b2e795bf6 Revise the webm files to more correctly identify audio tracks. 2016-07-13 10:41:06 -05:00
Jeremy White
5f67601534 Add tools for debugging media source playback events. 2016-07-13 10:41:03 -05:00
Jeremy White
a05764c0d6 Give the playback channel a separate debug control. 2016-07-13 10:41:02 -05:00
Pavel Grunt
789071cbfa Set nonhandled messages as not implemented
Avoid spamming log
2015-09-09 09:05:05 +02:00
Jeremy White
6c5f939e23 Add support for audio streams using the Opus encoding.
Requires a browser with MediaSource extension support, and
Opus support for the source buffers.  In practice, that is
Chrome and Firefox.
2014-05-20 12:59:27 -05:00