diff options
author | Clément Bœsch <u@pkh.me> | 2017-07-29 20:56:25 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-08-01 15:50:00 +0200 |
commit | f0f8da545d80665ae54d51df61e8f6903c85390a (patch) | |
tree | 22fe6bbbabdb2f484fee2ec6cf3835e50bc33f59 /tests/ref/fate | |
parent | b2d9d7226943d6229a17e31714ce5162bdf88b33 (diff) | |
download | ffmpeg-f0f8da545d80665ae54d51df61e8f6903c85390a.tar.gz |
lavc/htmlsubtitles: improve handling broken garbage
This commit switches off forced correct nesting of tags and only keeps
it for font tags. See long explanations in the code for the rationale.
This results in various FATE changes which I'll explain here:
- various swapping in font attributes, this is mostly noise due to the
old reverse stack way of printing them. The new one is more correct as
the last attribute takes over the previous ones.
- unrecognized tags disappears
- invalid tags that were previously displayed aren't anymore (instead,
we have a warning). This is better for the end user
The main benefit of this commit is to be more tolerant to error, leading
to a better handling of badly nested tags or random wrong formatting for
the end user.
Diffstat (limited to 'tests/ref/fate')
-rw-r--r-- | tests/ref/fate/sub-sami2 | 4 | ||||
-rw-r--r-- | tests/ref/fate/sub-srt | 14 | ||||
-rw-r--r-- | tests/ref/fate/sub-srt-badsyntax | 4 | ||||
-rw-r--r-- | tests/ref/fate/sub-textenc | 14 | ||||
-rw-r--r-- | tests/ref/fate/sub-webvttenc | 14 |
5 files changed, 25 insertions, 25 deletions
diff --git a/tests/ref/fate/sub-sami2 b/tests/ref/fate/sub-sami2 index 9e9c80870d..64656f06cb 100644 --- a/tests/ref/fate/sub-sami2 +++ b/tests/ref/fate/sub-sami2 @@ -19,7 +19,7 @@ Dialogue: 0,0:00:17.67,0:00:21.72,Default,,0,0,0,,\N{\c&HCBC0FF&}{\fs6}It's{\fs} Dialogue: 0,0:00:21.84,0:00:21.84,Default,,0,0,0,,\N{\u1}매력적인 세계에서\N이 모든 것이 펼쳐집니다{\u1}
Dialogue: 0,0:00:21.84,0:00:23.58,Default,,0,0,0,,\N{\i1}{\c&H9966CC&}of{\c}{\c&HC2A3E0&} what's{\c} {\c&HE0D1F0&}right{\c} {\c&HFCFAFE&}and{\c} wrong.{\i0}
Dialogue: 0,0:00:23.69,0:00:23.69,Default,,0,0,0,,\N{\i1}이 주제를 심오한 철학으로\N담아내고 있어요{\i0}
-Dialogue: 0,0:00:23.69,0:00:25.67,Default,,0,0,0,,\N{\fs20}{\c&HFF0000&}{\s1}It{\s0}{\c}{\fs} has {\fs15}{\c&HFFFF00&}a{\c}{\fs} great {\fs16}{\c&HFFCC00&}philosophy{\c}{\fs} about it.
+Dialogue: 0,0:00:23.69,0:00:25.67,Default,,0,0,0,,\N{\c&HFF0000&}{\fs20}{\s1}It{\s0}{\fs}{\c} has {\c&HFFFF00&}{\fs15}a{\fs}{\c} great {\c&HFFCC00&}{\fs16}philosophy{\fs}{\c} about it.
Dialogue: 0,0:00:40.22,0:00:40.22,Default,,0,0,0,,\N{\s1}"왕좌의 게임"은 웨스테로스라는 가상왕국의\N권력 분쟁 이야기입니다{\s0}
Dialogue: 0,0:00:40.22,0:00:47.94,Default,,0,0,0,,\N{\c&HA5FF&}{\fs26}"Game of Thrones"{\fs}{\c} {\c&H2A2AA5&}{\b1}is{\b0}{\c}{\c&HFFFF&}{\fs24}{\i1} about{\i0}{\fs}{\c} {\c&H336699&}{\fs14}power{\fs}{\c}{\c&HFF&} struggles{\c}\N{\c&HA5FF&}{\fs8}in a fantasy{\fs}{\c&HCBC0FF&} kingdom{\c&HA5FF&}, called {\fs6}Westeros.{\fs}{\c}
Dialogue: 0,0:00:48.06,0:00:48.06,Default,,0,0,0,,\N철의 왕좌를 둘러싼\N권력 분쟁이죠
@@ -51,7 +51,7 @@ Dialogue: 0,0:01:28.98,0:01:33.89,Default,,0,0,0,,\N{\u1}this common threat, tha Dialogue: 0,0:01:34.01,0:01:35.24,Default,,0,0,0,,\Npursuing their own interests.
Dialogue: 0,0:01:35.36,0:01:35.36,Default,,0,0,0,,\N한편, 일곱 왕국의 밖에서는\N두 개의 거대한 위협이 부상합니다
Dialogue: 0,0:01:35.36,0:01:40.23,Default,,0,0,0,,\N{\fs30}And meanwhile, outside the Seven\NKingdoms, two great threats arising.{\fs}
-Dialogue: 0,0:01:40.35,0:01:40.35,Default,,0,0,0,,\N<sup>하나는 바다 건너\N타가리엔 일족 유배자들이며</sub>
+Dialogue: 0,0:01:40.35,0:01:40.35,Default,,0,0,0,,\N하나는 바다 건너\N타가리엔 일족 유배자들이며
Dialogue: 0,0:01:40.35,0:01:44.06,Default,,0,0,0,,\NOne across the sea, in the exile\NTargaryen siblings,
Dialogue: 0,0:01:44.17,0:01:44.17,Default,,0,0,0,,\N또 하나는 일곱 왕국의\N국경이 자리잡은
Dialogue: 0,0:01:44.17,0:01:47.39,Default,,0,0,0,,\Nand another far to the north,\Nbeyond the Wall,
diff --git a/tests/ref/fate/sub-srt b/tests/ref/fate/sub-srt index 40b20cde90..fd60290929 100644 --- a/tests/ref/fate/sub-srt +++ b/tests/ref/fate/sub-srt @@ -14,10 +14,10 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,,Don't show this text it may be Dialogue: 0,0:00:01.50,0:00:04.50,Default,,0,0,0,,SubRip subtitles capability tester 1.3o by ale5000\N{\b1}{\i1}Use VLC 1.1 or higher as reference for most things and MPC Home Cinema for others{\i0}{\b0}\N{\c&HFF0000&}This text should be blue{\c}\N{\c&HFF&}This text should be red{\c}\N{\c&H0&}This text should be black{\c}\N{\fnWebdings}If you see this with the normal font, the player don't (fully) support font face{\fn}
Dialogue: 0,0:00:04.50,0:00:04.50,Default,,0,0,0,,Hidden
Dialogue: 0,0:00:04.50,0:00:07.50,Default,,0,0,0,,{\fs8}This text should be small{\fs}\NThis text should be normal\N{\fs35}This text should be big{\fs}
-Dialogue: 0,0:00:07.50,0:00:11.50,Default,,0,0,0,,This should be an E with an accent: È\N日本語\N{\fs30}{\b1}{\i1}{\u1}This text should be bold, italics and underline{\u0}{\i0}{\b0}{\fs}\N{\fs9}{\c&HFF00&}This text should be small and green{\c}{\fs}\N{\fs9}{\c&HFF&}This text should be small and red{\c}{\fs}\N{\fs24}{\c&H2A2AA5&}This text should be big and brown{\c}{\fs}
+Dialogue: 0,0:00:07.50,0:00:11.50,Default,,0,0,0,,This should be an E with an accent: È\N日本語\N{\fs30}{\b1}{\i1}{\u1}This text should be bold, italics and underline{\u0}{\i0}{\b0}{\fs}\N{\fs9}{\c&HFF00&}This text should be small and green{\fs}{\c}\N{\c&HFF&}{\fs9}This text should be small and red{\fs}{\c}\N{\c&H2A2AA5&}{\fs24}This text should be big and brown{\fs}{\c}
Dialogue: 0,0:00:11.50,0:00:14.50,Default,,0,0,0,,{\b1}This line should be bold{\b0}\N{\i1}This line should be italics{\i0}\N{\u1}This line should be underline{\u0}\N{\s1}This line should be strikethrough{\s0}\N{\u1}Both lines\Nshould be underline{\u0}
-Dialogue: 0,0:00:14.50,0:00:17.50,Default,,0,0,0,,>\NIt would be a good thing to\Nhide invalid html tags that are closed and show the text in them\N<invalid_tag_unclosed>but show un-closed invalid html tags\NShow not opened tags</invalid_tag_not_opened>\N<
-Dialogue: 0,0:00:17.50,0:00:20.50,Default,,0,0,0,,and also\Nhide invalid html tags with parameters that are closed and show the text in them\N<invalid_tag_uc par=5>but show un-closed invalid html tags\N{\u1}This text should be showed underlined without problems also: 2<3,5>1,4<6{\u0}\NThis shouldn't be underlined
+Dialogue: 0,0:00:14.50,0:00:17.50,Default,,0,0,0,,>\NIt would be a good thing to\Nhide invalid html tags that are closed and show the text in them\Nbut show un-closed invalid html tags\NShow not opened tags\N<
+Dialogue: 0,0:00:17.50,0:00:20.50,Default,,0,0,0,,and also\Nhide invalid html tags with parameters that are closed and show the text in them\Nbut show un-closed invalid html tags\N{\u1}This text should be showed underlined without problems also: 2<3,5>1,4<6{\u0}\NThis shouldn't be underlined
Dialogue: 0,0:00:20.50,0:00:21.50,Default,,0,0,0,,This text should be in the normal position...
Dialogue: 0,0:00:21.50,0:00:22.50,Default,,0,0,0,,{\an5}{\pos(0,45)}This text should NOT be in the normal position
Dialogue: 0,0:00:22.50,0:00:24.50,Default,,0,0,0,,Implementation is the same of the ASS tag\N{\an8}This text should be at the\Ntop and horizontally centered
@@ -29,7 +29,7 @@ Dialogue: 0,0:00:24.50,0:00:26.50,Default,,0,0,0,,{\an1}This text should be at t Dialogue: 0,0:00:26.50,0:00:28.50,Default,,0,0,0,,{\an9}This text should be at the\Ntop and horizontally at the right
Dialogue: 0,0:00:26.50,0:00:28.50,Default,,0,0,0,,{\an6}This text should be at the\Nmiddle and horizontally at the right
Dialogue: 0,0:00:26.50,0:00:28.50,Default,,0,0,0,,{\an3}This text should be at the\Nbottom and horizontally at the right
-Dialogue: 0,0:00:28.50,0:00:31.50,Default,,0,0,0,,{\fs6}{\c&HFF00&}This could be the {\fs35}m{\c&H0&}o{\c&HFF00&}st{\fs6} difficult thing to implement{\c}{\fs}
+Dialogue: 0,0:00:28.50,0:00:31.50,Default,,0,0,0,,{\c&HFF00&}{\fs6}This could be the {\fs35}m{\c&H0&}o{\c&HFF00&}st{\fs6} difficult thing to implement{\fs}{\c}
Dialogue: 0,0:00:31.50,0:00:50.50,Default,,0,0,0,,First text
Dialogue: 0,0:00:33.50,0:00:35.50,Default,,0,0,0,,Second, it shouldn't overlap first
Dialogue: 0,0:00:35.50,0:00:37.50,Default,,0,0,0,,Third, it should replace second
@@ -44,6 +44,6 @@ Dialogue: 0,0:00:54.50,0:00:56.50,Default,,0,0,0,,{\an1}\N\h\h\h\h\hA (05 hard s Dialogue: 0,0:00:56.50,0:00:58.50,Default,,0,0,0,,\h\h\h\h\hA (05 hard spaces followed by a letter)\NA (Normal spaces followed by a letter)\NA (No hard spaces followed by a letter)\NShow this: \TEST and this: \-)
Dialogue: 0,0:00:58.50,0:01:00.50,Default,,0,0,0,,{\an3}\NA letter followed by 05 hard spaces: A\h\h\h\h\h\NA letter followed by normal spaces: A\NA letter followed by no hard spaces: A\N05 hard spaces between letters: A\h\h\h\h\hA\N5 normal spaces between letters: A A\N\N^--Forced line break
Dialogue: 0,0:01:00.50,0:01:02.50,Default,,0,0,0,,{\s1}Both line should be strikethrough,\Nyes.{\s0}\NCorrectly closed tags\Nshould be hidden.
-Dialogue: 0,0:01:02.50,0:01:04.50,Default,,0,0,0,,It shouldn't be strikethrough,\Nnot opened tag showed as text.</s>\NNot opened tag showed as text.</xxxxx>
-Dialogue: 0,0:01:04.50,0:01:06.50,Default,,0,0,0,,{\s1}Three lines should be strikethrough,\Nyes.\N<yyyy>Not closed tags showed as text
-Dialogue: 0,0:01:06.50,0:01:08.50,Default,,0,0,0,,{\s1}Both line should be strikethrough but\Nthe wrong closing tag should be showed</b>
+Dialogue: 0,0:01:02.50,0:01:04.50,Default,,0,0,0,,It shouldn't be strikethrough,\Nnot opened tag showed as text.{\s0}\NNot opened tag showed as text.
+Dialogue: 0,0:01:04.50,0:01:06.50,Default,,0,0,0,,{\s1}Three lines should be strikethrough,\Nyes.\NNot closed tags showed as text
+Dialogue: 0,0:01:06.50,0:01:08.50,Default,,0,0,0,,{\s1}Both line should be strikethrough but\Nthe wrong closing tag should be showed{\b0}
diff --git a/tests/ref/fate/sub-srt-badsyntax b/tests/ref/fate/sub-srt-badsyntax index 1ee2f95dcc..791e00e691 100644 --- a/tests/ref/fate/sub-srt-badsyntax +++ b/tests/ref/fate/sub-srt-badsyntax @@ -14,8 +14,8 @@ Dialogue: 0,0:00:01.00,0:00:02.31,Default,,0,0,0,,<<<<<< Antes <<<<<<\NEla é hu Dialogue: 0,0:01:10.00,0:01:14.50,Default,,0,0,0,,>>> RebelSubTeam <<<
Dialogue: 0,0:02:37.75,0:02:43.70,Default,,0,0,0,,{\b1}~ASUKO MARCH!~\N>>:<<\Ntranslation by: cangii\NRetiming by: furransu{\b0}
Dialogue: 0,0:03:38.32,0:03:42.78,Default,,0,0,0,,<<THE HIGH ROLLERS>>\N<<Grandes Jogadores>>
-Dialogue: 0,0:04:50.43,0:05:01.03,Default,,0,0,0,,<<flash gordon\N<E9>pisode 4\Nsaison 1>\Nwww.SeriesSub.com>
-Dialogue: 0,0:20:31.85,0:20:56.84,Default,,0,0,0,,{\c&HFFFFFFFF&}\N<<<<www.egfire.com>>>>{\c}
+Dialogue: 0,0:04:50.43,0:05:01.03,Default,,0,0,0,,<<flash gordon\Npisode 4\Nsaison 1>\Nwww.SeriesSub.com>
+Dialogue: 0,0:20:31.85,0:20:56.84,Default,,0,0,0,,\N<<<<www.egfire.com>>>>
Dialogue: 0,0:37:59.69,0:38:01.59,Default,,0,0,0,,mint asztalt foglaltatni\Na <<>Le Cirque-ben.
Dialogue: 0,0:53:43.78,0:53:45.94,Default,,0,0,0,,<<That's OK, >> - he calmed himself.
Dialogue: 0,0:53:46.22,0:53:49.09,Default,,0,0,0,,<<lt's not a long way to the hotel,\Nthe hotel is within easy reach.
diff --git a/tests/ref/fate/sub-textenc b/tests/ref/fate/sub-textenc index f7d82ce79a..3ea56b38f0 100644 --- a/tests/ref/fate/sub-textenc +++ b/tests/ref/fate/sub-textenc @@ -44,15 +44,15 @@ should be underline >
It would be a good thing to
hide invalid html tags that are closed and show the text in them
-<invalid_tag_unclosed>but show un-closed invalid html tags
-Show not opened tags</invalid_tag_not_opened>
+but show un-closed invalid html tags
+Show not opened tags
< 8 00:00:17,501 --> 00:00:20,500 and also
hide invalid html tags with parameters that are closed and show the text in them
-<invalid_tag_uc par=5>but show un-closed invalid html tags
+but show un-closed invalid html tags
This text should be showed underlined without problems also: 2<3,5>1,4<6
This shouldn't be underlined @@ -197,17 +197,17 @@ should be hidden. 35 00:01:02,501 --> 00:01:04,500 It shouldn't be strikethrough,
-not opened tag showed as text.</s>
-Not opened tag showed as text.</xxxxx> +not opened tag showed as text.
+Not opened tag showed as text. 36 00:01:04,501 --> 00:01:06,500 Three lines should be strikethrough,
yes.
-<yyyy>Not closed tags showed as text +Not closed tags showed as text 37 00:01:06,501 --> 00:01:08,500 Both line should be strikethrough but
-the wrong closing tag should be showed</b> +the wrong closing tag should be showed diff --git a/tests/ref/fate/sub-webvttenc b/tests/ref/fate/sub-webvttenc index ba567c33f6..45ae0b6131 100644 --- a/tests/ref/fate/sub-webvttenc +++ b/tests/ref/fate/sub-webvttenc @@ -39,14 +39,14 @@ should be underline</u> > It would be a good thing to hide invalid html tags that are closed and show the text in them -<invalid_tag_unclosed>but show un-closed invalid html tags -Show not opened tags</invalid_tag_not_opened> +but show un-closed invalid html tags +Show not opened tags < 00:17.501 --> 00:20.500 and also hide invalid html tags with parameters that are closed and show the text in them -<invalid_tag_uc par=5>but show un-closed invalid html tags +but show un-closed invalid html tags <u>This text should be showed underlined without problems also: 2<3,5>1,4<6</u> This shouldn't be underlined @@ -164,14 +164,14 @@ should be hidden. 01:02.501 --> 01:04.500 It shouldn't be strikethrough, -not opened tag showed as text.</s> -Not opened tag showed as text.</xxxxx> +not opened tag showed as text. +Not opened tag showed as text. 01:04.501 --> 01:06.500 Three lines should be strikethrough, yes. -<yyyy>Not closed tags showed as text +Not closed tags showed as text 01:06.501 --> 01:08.500 Both line should be strikethrough but -the wrong closing tag should be showed</b> +the wrong closing tag should be showed |