summaryrefslogtreecommitdiff
path: root/tests/fate/subtitles.mak
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2015-12-22 23:11:41 +0100
committerClément Bœsch <u@pkh.me>2016-01-01 18:31:49 +0100
commit77eeaa2c3dec9d0e374ea5597d002527306261ec (patch)
tree39bdccd2b1d104cb4ed2e4c24e176f53a111a2c3 /tests/fate/subtitles.mak
parent5236cf871818e0df256c18aecd3abfe88b428027 (diff)
lavf/srtdec: rewrite parsing logic
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.
Diffstat (limited to 'tests/fate/subtitles.mak')
-rw-r--r--tests/fate/subtitles.mak9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 267c09e640..d273f2efaa 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -52,6 +52,15 @@ fate-sub-sami2: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/SAMI_multilang_twea
FATE_SUBTITLES_ASS-$(call DEMDEC, SRT, SUBRIP) += fate-sub-srt
fate-sub-srt: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt
+FATE_SUBTITLES-$(call ALLYES, SRT_DEMUXER SUBRIP_DECODER SRT_MUXER) += fate-sub-srt-rrn-remux
+fate-sub-srt-rrn-remux: CMD = fmtstdout srt -i $(TARGET_SAMPLES)/sub/ticket5032-rrn.srt -c:s copy
+
+FATE_SUBTITLES-$(call ALLYES, SRT_DEMUXER SUBRIP_DECODER SRT_MUXER) += fate-sub-srt-madness-timeshift
+fate-sub-srt-madness-timeshift: CMD = fmtstdout srt -itsoffset 3.14 -i $(TARGET_SAMPLES)/sub/madness.srt -c:s copy
+
+FATE_SUBTITLES-$(call ALLYES, SRT_DEMUXER SUBRIP_DECODER SRT_MUXER) += fate-sub-srt-empty-events
+fate-sub-srt-empty-events: CMD = fmtstdout srt -i $(TARGET_SAMPLES)/sub/empty-events-2167.srt -c:s copy
+
FATE_SUBTITLES_ASS-$(call DEMDEC, STL, STL) += fate-sub-stl
fate-sub-stl: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/STL_capability_tester.stl