• Clément Bœsch's avatar
    lavf/srtdec: rewrite parsing logic · 77eeaa2c
    Clément Bœsch authored
    Fixes Ticket #5032
    
    The samples in Ticket #5032 is using \r\r\n as line breaks.  Since we
    already are handling \r, or \n, or \r\n as line breaks, \r\n\n will be
    considered as a double line breaks. This is an issue because
    ff_subtitles_read_text_chunk() will as a result stop extracting a chunk
    after just one line.
    
    So instead of parsing the SRT by "chunks" (which means splitting every
    double LB), this new parser is detecting timing lines, and split the
    events on this basis. While this sounds safe and simple, it needs to
    take into account the event number preceding the timing line while
    handling situations such as:
    
     - event number starting at 0 or actually any number instead of 1
     - event numbers not being ordered at all
     - event number being followed by text garbage (this really happened,
       see Ticket #4898)
     - event payload containing one or multiple number (a protagonist saying
       a count-down, a date or whatever) which could be confused with a
       chapter number
     - event number being empty (see Ticket #2167)
     - all kind of weird line breaks can appear randomly like wild pokémons
     - untrustable line breaks (Ticket #5032)
    
    The sample madness.srt tries to sum up most of this into one sample,
    ticket5032-rrn.srt is the file containing \r\r\n line breaks. and
    empty-events-2167.srt contains empty events.
    77eeaa2c
Name
Last commit
Last update
..
aac.mak Loading commit data...
ac3.mak Loading commit data...
acodec.mak Loading commit data...
adpcm.mak Loading commit data...
alac.mak Loading commit data...
als.mak Loading commit data...
amrnb.mak Loading commit data...
amrwb.mak Loading commit data...
api.mak Loading commit data...
atrac.mak Loading commit data...
audio.mak Loading commit data...
avformat.mak Loading commit data...
bmp.mak Loading commit data...
cdxl.mak Loading commit data...
checkasm.mak Loading commit data...
concatdec.mak Loading commit data...
cover-art.mak Loading commit data...
demux.mak Loading commit data...
dfa.mak Loading commit data...
dnxhd.mak Loading commit data...
dpcm.mak Loading commit data...
ea.mak Loading commit data...
exif.mak Loading commit data...
ffmpeg.mak Loading commit data...
ffprobe.mak Loading commit data...
fft.mak Loading commit data...
filter-audio.mak Loading commit data...
filter-video.mak Loading commit data...
flac.mak Loading commit data...
gapless.mak Loading commit data...
gif.mak Loading commit data...
h264.mak Loading commit data...
hevc.mak Loading commit data...
image.mak Loading commit data...
indeo.mak Loading commit data...
libavcodec.mak Loading commit data...
libavdevice.mak Loading commit data...
libavformat.mak Loading commit data...
libavresample.mak Loading commit data...
libavutil.mak Loading commit data...
libswresample.mak Loading commit data...
lossless-audio.mak Loading commit data...
lossless-video.mak Loading commit data...
microsoft.mak Loading commit data...
monkeysaudio.mak Loading commit data...
mp3.mak Loading commit data...
mpc.mak Loading commit data...
mpeg4.mak Loading commit data...
mxf.mak Loading commit data...
opus.mak Loading commit data...
pcm.mak Loading commit data...
probe.mak Loading commit data...
prores.mak Loading commit data...
qt.mak Loading commit data...
qtrle.mak Loading commit data...
real.mak Loading commit data...
screen.mak Loading commit data...
seek.mak Loading commit data...
source-check.sh Loading commit data...
source.mak Loading commit data...
subtitles.mak Loading commit data...
utvideo.mak Loading commit data...
vcodec.mak Loading commit data...
video.mak Loading commit data...
voice.mak Loading commit data...
vorbis.mak Loading commit data...
vpx.mak Loading commit data...
vqf.mak Loading commit data...
wavpack.mak Loading commit data...
wma.mak Loading commit data...
xvid.mak Loading commit data...