• Timothy B. Terriberry's avatar
    Improve handling of holes (corrupt pages). · fd65b94f
    Timothy B. Terriberry authored
    Previously, when we encountered a hole (a gap in the page sequence
     numbers), we would save off all of the packets from the first page
     after the hole, but not timestamp them.
    That meant when they were actually decoded, op_pcm_tell() would
     report a timestamp of 0 until reaching the last packet on that
     page.
    
    Instead, handle holes just like a raw seek.
    We reset the granule position tracking, and attempt to timestamp
     packets backwards from the end of the page.
    If the first page after the hole is an EOS page, we just throw it
     away (rather than risk playing invalid samples due to incorrect
     end-trimming).
    We also throw away the first 80 ms of audio after a hole, to allow
     the decoder state to reconverge.
    
    This patch also updates the example to report the hole and
     continue decoding, rather than immediately stopping when a hole is
     encountered, in order to test the above features.
    fd65b94f
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...