GNOME Bugzilla – Bug 555607
subrip subtitles typefind too strict
Last modified: 2009-01-05 19:21:54 UTC
Please describe the problem: I have a (malformed?) srt file that doesn't get detected as a subtitle file by gstreamer sub parse. (whereas it works with other mediaplayers) it looks like: ===== 1 0: 0:26, 26 --> 0: 0:28, 17 I can't see. 2 0: 0:30, 30 --> 0: 0:33, 22 I really can't see. 3 0: 0:40, 40 --> 0: 0:44, 44 I still can't see anything. [...] ====== But if I just change the first two lines, filling with '0' instead of spaces: ===== 1 00:00:26,026 --> 00:00:28,017 I can't see. 2 0: 0:30, 30 --> 0: 0:33, 22 I really can't see. 3 0: 0:40, 40 --> 0: 0:44, 44 I still can't see anything. [...] ============ all works as expected. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
applying this simple change fixes the problem: --- gstsubparse.c.orig 2008-10-08 21:32:17.000000000 +0200 +++ gstsubparse.c 2008-10-08 21:24:13.000000000 +0200 @@ -913,9 +913,9 @@ need_init_regexps = FALSE; if ((err = regcomp (&mdvd_rx, "^\\{[0-9]+\\}\\{[0-9]+\\}", REG_EXTENDED | REG_NEWLINE | REG_NOSUB) != 0) || - (err = regcomp (&subrip_rx, "^[0-9]([0-9]){0,3}(\x0d)?\x0a" - "[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{3}" - " --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{3}", + (err = regcomp (&subrip_rx, "^([ 0-9]){0,3}[0-9](\x0d)?\x0a" + "[ 0-9][0-9]:[ 0-9][0-9]:[ 0-9][0-9],[ 0-9]{3}" + " --> [ 0-9][0-9]:[ 0-9][0-9]:[ 0-9][0-9],[ 0-9]{3}", REG_EXTENDED | REG_NEWLINE | REG_NOSUB)) != 0) { regerror (err, &subrip_rx, errstr, 127); GST_WARNING ("Compilation of subrip regex failed: %s", errstr);
Committed with some smaller changes... Thanks :) 2008-10-10 Sebastian Dröge <sebastian.droege@collabora.co.uk> Based on a patch by: xavierb at gmail dot com * gst/subparse/gstsubparse.c: (gst_sub_parse_data_format_autodetect): * tests/check/elements/subparse.c: (GST_START_TEST): Make the detection of the used subtitle a bit less strict for srt subtitles. Fixes bug #555607.
*** Bug 565309 has been marked as a duplicate of this bug. ***