public void Dispose() { HasEndOfStream = true; if (_container != null) { _container.DisposePacketReader(this); } _container = null; _current = null; if (_first != null) { var node = _first; _first = null; while (node.Next != null) { var tmp = node.Next; node.Next = null; node = tmp; node.Prev = null; } } _last = null; }
public static OggPacket Rent(OggContainerReader reader, long streamOffset, int length) { lock (_mutex) { if (_pool.Count > 0) { var packet = _pool.Pop(); packet.Set(reader, streamOffset, length); return(packet); } return(new OggPacket(reader, streamOffset, length)); } }
public VorbisReader(Stream stream, bool leaveOpen) : this() { // try Ogg first var oggContainer = new Ogg.OggContainerReader(stream, leaveOpen); if (!LoadContainer(oggContainer)) { // oops, not Ogg! // we don't support any other container types yet, so error out // TODO: Add Matroska fallback oggContainer.Dispose(); throw new InvalidDataException("Could not determine container type."); } _containerReader = oggContainer; if (_decoders.Count == 0) { throw new InvalidDataException("No Vorbis data found."); } }
internal OggPacketReader(OggContainerReader container, int streamSerial) { _container = container; StreamSerial = streamSerial; }