After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 555607 - subrip subtitles typefind too strict
subrip subtitles typefind too strict
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.21
Other All
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-08 20:24 UTC by xbx
Modified: 2009-01-05 19:21 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description xbx 2008-10-08 20:24:00 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:
Comment 1 xbx 2008-10-08 20:26:18 UTC
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);
Comment 2 Sebastian Dröge (slomo) 2008-10-10 15:31:53 UTC
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.
Comment 3 Tim-Philipp Müller 2009-01-05 17:20:54 UTC
*** Bug 565309 has been marked as a duplicate of this bug. ***
Comment 4 Tim-Philipp Müller 2009-01-05 19:21:54 UTC
*** Bug 565309 has been marked as a duplicate of this bug. ***