Undo OGG API deprecation

Add a warning that it's a single track / header instead.
And plan the deprecation for the next major release.
This commit is contained in:
Joe Turki
2025-12-20 21:02:13 +02:00
parent d8828d6df0
commit 39dee988fe

View File

@@ -123,7 +123,11 @@ type Option func(*OggReader) error
// NewWith returns a new Ogg reader and Ogg header // NewWith returns a new Ogg reader and Ogg header
// with an io.Reader input. // with an io.Reader input.
// Deprecated: Use NewWithOptions instead. //
// Warning: NewWith only parses the first OpusHead (a single logical bitstream/track)
// and returns a single OggHeader. If you need to handle Ogg containers with multiple
// Opus headers/tracks, use NewWithOptions and scan pages (e.g. via ParseNextPage)
// to find and parse each OpusHead.
func NewWith(in io.Reader) (*OggReader, *OggHeader, error) { func NewWith(in io.Reader) (*OggReader, *OggHeader, error) {
return newWith(in /* doChecksum */, true) return newWith(in /* doChecksum */, true)
} }