• Timothy B. Terriberry's avatar
    Harmonize op_raw_total() and op_raw_seek() · 37f83754
    Timothy B. Terriberry authored
    op_raw_seek() will fail if you try to seek to a byte position
     beyond the end of the file.
    However, the "end" is defined in terms of _of->end, which is
     specifically the end of the last Ogg page found in the underlying
     source (excluding any trailing non-Ogg data).
    op_raw_total(_of,-1) returns the total size of the stream by using
     _of->end, but it was also subtracting the offset of the first Opus
     page in the first link.
    Since there might have been other Ogg streams concurrently
     multiplexed with the first Opus stream whose BOS pages appear
     first, or there might simply be non-Ogg junk at the start, that
     left the caller with no way to determine the valid range of byte
     offsets that could be passed to op_raw_seek().
    
    Instead, make op_raw_total() pretend the first link starts at
     offset 0, and explicitly document that it's what defines the range
     of valid values to op_raw_seek().
    This is how our own seeking_example.c was using it, anyway.
    37f83754
Name
Last commit
Last update
ci Loading commit data...
doc Loading commit data...
examples Loading commit data...
include Loading commit data...
m4 Loading commit data...
mingw Loading commit data...
src Loading commit data...
unix Loading commit data...
win32 Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
Makefile.am Loading commit data...
README.md Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
opusfile-uninstalled.pc.in Loading commit data...
opusfile.pc.in Loading commit data...
opusurl-uninstalled.pc.in Loading commit data...
opusurl.pc.in Loading commit data...
releases.sha2 Loading commit data...
update_version Loading commit data...