diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-09 12:13:16 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-09 12:13:16 +0200 |
commit | 88a55e6daec414916b74ba8cf688e914e2c6dfef (patch) | |
tree | 078dbdf65c62f8b0a7a21eb391e1626aa7197a88 /gst | |
parent | 0021e6b765634d7e0d08abbd1820636b23a006de (diff) |
subparse: Allow . instead of , as millisecond delimiter in srt subtitles
Fixes bug #591207.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/subparse/gstsubparse.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index b319f70ab..eb6c9042c 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -831,11 +831,13 @@ parse_subrip_time (const gchar * ts_string, GstClockTime * t) * hh:mm:ss, 5 = 50ms * hh:mm:ss, 50 = 50ms * hh:mm:ss,5 = 500ms - * and sscanf() doesn't differentiate between ' 5' and '5' so munge + * and the same with . instead of ,. + * sscanf() doesn't differentiate between ' 5' and '5' so munge * the white spaces within the timestamp to '0' (I'm sure there's a * way to make sscanf() do this for us, but how?) */ g_strdelimit (s, " ", '0'); + g_strdelimit (s, ".", ','); /* make sure we have exactly three digits after he comma */ p = strchr (s, ','); @@ -1125,8 +1127,8 @@ gst_sub_parse_data_format_autodetect_regex_once (GstSubParseRegex regtype) break; case GST_SUB_PARSE_REGEX_SUBRIP: result = (gpointer) g_regex_new ("^([ 0-9]){0,3}[0-9]\\s*(\x0d)?\x0a" - "[ 0-9][0-9]:[ 0-9][0-9]:[ 0-9][0-9],[ 0-9]{0,2}[0-9]" - " +--> +([ 0-9])?[0-9]:[ 0-9][0-9]:[ 0-9][0-9],[ 0-9]{0,2}[0-9]", + "[ 0-9][0-9]:[ 0-9][0-9]:[ 0-9][0-9][,.][ 0-9]{0,2}[0-9]" + " +--> +([ 0-9])?[0-9]:[ 0-9][0-9]:[ 0-9][0-9][,.][ 0-9]{0,2}[0-9]", 0, 0, &gerr); if (result == NULL) { g_warning ("Compilation of subrip regex failed: %s", gerr->message); |