Skip to content
  • wm4's avatar
    avformat/mp3dec: avoid early EOF with concatenated gapless mp3s · 6c7f1155
    wm4 authored
    
    
    Consider a file created with something like:
    
        cat file1.mp3 file2.mp3 > result.mp3
    
    Then if file2.mp3 has gapless information, result.mp3 would stop playing
    something in the middle. This happens because the gapless info directs
    the decoder to discard all samples after a certain position. To make
    matters worse, the gapless info of file2.mp3 will be used when playing
    the file1.mp3 part, because the gapless info is located at the end of
    the file.
    
    While handling concatenated gapless files correctly would be insane and
    a lot of effort (especially without scanning the whole file on opening),
    it's easy to prevent at least early EOF. Playback will happen to work,
    even if it's slightly broken.
    
    Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
    6c7f1155