• Francois Cartegnie's avatar
    demux: ogg: rewrite pts and pts computation (fix #9828) · ff681fc7
    Francois Cartegnie authored
    - Previous algorithm was unable to guess the first packet
    pts because of ogg design (some codecs/opus/vorbis have total
    sample at page granule and only granule on last packet. You
    then need to compute first packet pts backward using packets
    duration).
    So we were stuck either assuming a start at pts/pcr zero, or
    be unable to handle ogg streaming (non zero start) correctly,
    or had to always drop the 0..N-1 packets for first page.
    We need libvorbis to correcly compute those durations (code
    is far more complex than opus's one).
    - Refactorized to discard the tons of cases appended
    with each new codec.
    - lots of other fixes in many places
    ff681fc7
ogg.c 116 KB