TooTallNate / node-icy

Node.js module for parsing and/or injecting ICY metadata
MIT License
291 stars 48 forks source link

Allow a different initial interval in Writer #10

Closed ewr closed 11 years ago

ewr commented 11 years ago

For StreamMachine, I'm working on being able to hand off all connections to a new process to allow seamless restarts. To do that with an Icecast writer, I need a way to tell the new process that it should write less than a full chunk of data before the first meta injection.

I'm grabbing _parserBytesLeft from the original icecast writer, and then passing that in to the new one as initialMetaInt.

TooTallNate commented 11 years ago

Why not just change the metaint value of the writer after the initial constructor call? The first "passthrough" call will already have been queued at that point in the parser:

var metaint = 8192;
var initial = oldWriter._parserBytesLeft;
var writer = new Writer(initial);
writer.metaint = metaint;

Thanks, but no thanks.