TooTallNate / node-ogg

Node.js native binding to libogg
MIT License
65 stars 36 forks source link

Fixed afterPacketout() to retry recoverable warnings #6

Closed brandonkirsch closed 5 years ago

brandonkirsch commented 9 years ago

Added extra handling in DecoderStream.afterPacketout() to deal with recoverable errors in libogg's ogg_stream_packetout.

Now afterPacketout() will correctly retry when ogg_stream_packetout sets rtn = -1

This makes node-ogg more resilient to imperfect (but perfectly usable) ogg streams.

For more info: http://xiph.org/ogg/doc/libogg/ogg_stream_packetout.html

TooTallNate commented 9 years ago

This looks good, but do you have a sample OGG file where this is relevant?

brandonkirsch commented 9 years ago

This is relevant in streaming situations, such as tuning into an Icecast broadcast that's in mid-stream.

In the .ogg file I've linked to below, I captured ~ 5 seconds of a live Icecast stream to disk.

https://brandonkirsch.com/media/myOggRip.ogg

tobiasmuecksch commented 6 years ago

@TooTallNate why hasn't this been merged yet? I could really use that 👍

LinusU commented 5 years ago

rebased and fixed white space issues here 👉 #19

sorry for the very long delay in getting this in 🙈 ❤️