concentus.oggfile
concentus.oggfile copied to clipboard
Library does not work if input stream cannot provide Length
Some streams, for example chunked network stream produced by httpclient do not have .Length property. If you try to read this stream, it will crash internally on initialize.
Stream stream = await new HttpClient().GetStreamAsync("http://durandal.dnsalias.net/goons/casserole.opus");
OpusOggReadStream readStream = new OpusOggReadStream(new OpusDecoder(48000, 2), stream);
readStream.DecodeNextPacket();
Works fine for me? Can you provide repro code?
whoops, never mind. It doesn't throw an exception, but it does stop working....
Hmmmm yeah, the exception is being thrown from StreamReadBuffer when it's trying to seek to the beginning of a page, on the assumption that the page has been buffered locally from the network. This codebase is forked from NVorbis which has since changed a lot and removed this entire code path.
I don't know if there is a quick fix. The whole point of the buffered intermediate stream seems like it was supposed to make short-term seeking possible, but it doesn't actually work (I didn't write this code)
whoops, never mind. It doesn't throw an exception, but it does stop working....
Yeah exception is caught internally.. sorry for bad explanation
I might have fixed this with #23, but I don't quite remember as that code has been hanging around for a few months and I don't fully remember it.