Skip to content
  • Rémi Denis-Courmont's avatar
    demux: restore stream offset before probing (fixes #18502) · 11874bc5
    Rémi Denis-Courmont authored
    There are (roughly) three ways that a demux probe function can fail:
    - file type does not match,
    - file type matches but corruption is detected early,
    - unexpected I/O error.
    
    In the first case, the demuxer will typically not move the "virtual"
    file offset - mostly using vlc_stream_Peek(). But in the later two
    cases, the demuxer will typically have moved the file offset forward.
    
    There are no generic ways to fix it. Seeking back might fail (leading
    to ingored result warning). So we try to fix it in generic way before
    trying the next demuxer. If it fails, such as due to unrecoverable I/O
    error, we just skip it completely.
    11874bc5