Re: Behavior of source nodes on connect/disconnect

On Sep 13, 2013, at 12:47 PM, Robert O'Callahan <robert@ocallahan.org> wrote:

> On Fri, Sep 13, 2013 at 8:39 AM, Jer Noble <jer.noble@apple.com> wrote:
> I’m going to have to take up the mantle of Chris and disagree with you strongly here.  Disconnected nodes are disassociated from the graph entirely.  They do not participate in rendering to the destination node, and they no longer are connected to the destination node’s timeline.
> 
> OK, but that's not what the spec currently says and adding that behavior to the spec is a large change. So this discussion should really be framed as a proposal to make this change to the spec. As such, it would be helpful to see the proposed change written down in more detail.

Since the spec is entirely silent (pun most definitely intended) on the issue, it’ll be a spec change either way.

> Philosophically speaking, disconnected nodes are collected by GC because they are no longer active. But if disconnected nodes continue to "play", we would either be GCing active objects, or not GCing disconnected objects, effectively leaking nodes with no end time.  Neither of which are good options.
> 
> In most cases, the ongoing playback of disconnected nodes is not observable, and therefore they can be safely destroyed even though they're active.

That is why it was a philosophical, not practical objection. ;)

> Practically speaking, disconnecting a sub-graph is the only way deleopers can "pause" playback. If we force disconnected nodes to continue playing, the only way to pause playback would be to entirely tear down and re-create a subgraph.
> 
> I agree with Chris Wilson; if we're going to support pausing, let's support it properly with a pause/resume API.
> 
> Pausing a MediaStream/ElementAudioSourceNode is not a problem. You just drop data from the input stream while paused.

We’ve asked for a pause()/resume() API in the past and never got anywhere.  See: <https://www.w3.org/2011/audio/track/issues/5>

-Jer

Received on Friday, 13 September 2013 20:08:59 UTC