Skip to content
  • Edward Hervey's avatar
    vorbisdec: Improve "new headers while initialized" handling · aab5cccc
    Edward Hervey authored
    If new headers arrive after we are initialized, we need to make
    sure that they are indeed valid.
    
    A vorbis bitstream always begins with three header packets and must
    be in order.
    
    Also some streams have unframed (invalid?) headers that might
    confuse and disrupt the decoding process.
    
    Therefore if ever we see new headers, we accumulate them and once
    we get a non-header packet we check them to make sure that:
    * We have at least 3 headers
    * They are the expected ones (identification, comments and setup)
    * They are in order
    * Any other "header" is ignored
    
    If those conditions are met, we reset and reconfigure the decoder
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784530
    aab5cccc