mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
subparse: Allow newlines/whitespace at the beginning of subrip files
For example the Sintel subtitles have this and without this change they're detected as text/plain and not usable as subtitles. The parser itself already handles this just fine.
This commit is contained in:
parent
04a2610444
commit
ecb7156822
1 changed files with 2 additions and 1 deletions
|
@ -1211,7 +1211,8 @@ gst_sub_parse_data_format_autodetect_regex_once (GstSubParseRegex regtype)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_SUB_PARSE_REGEX_SUBRIP:
|
case GST_SUB_PARSE_REGEX_SUBRIP:
|
||||||
result = (gpointer) g_regex_new ("^ {0,3}[ 0-9]{1,4}\\s*(\x0d)?\x0a"
|
result = (gpointer)
|
||||||
|
g_regex_new ("^[\\s\\n]*[\\n]? {0,3}[ 0-9]{1,4}\\s*(\x0d)?\x0a"
|
||||||
" ?[0-9]{1,2}: ?[0-9]{1,2}: ?[0-9]{1,2}[,.] {0,2}[0-9]{1,3}"
|
" ?[0-9]{1,2}: ?[0-9]{1,2}: ?[0-9]{1,2}[,.] {0,2}[0-9]{1,3}"
|
||||||
" +--> +[0-9]{1,2}: ?[0-9]{1,2}: ?[0-9]{1,2}[,.] {0,2}[0-9]{1,2}",
|
" +--> +[0-9]{1,2}: ?[0-9]{1,2}: ?[0-9]{1,2}[,.] {0,2}[0-9]{1,2}",
|
||||||
G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, &gerr);
|
G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, &gerr);
|
||||||
|
|
Loading…
Reference in a new issue