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 502497 - [subparse] SubRip subtitles starting from 0 not recognised
[subparse] SubRip subtitles starting from 0 not recognised
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal minor
: 0.10.16
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-08 14:48 UTC by Robin Stocker
Modified: 2007-12-08 18:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
make subparse recognise srt subtitles starting with index 0 (864 bytes, patch)
2007-12-08 14:52 UTC, Robin Stocker
committed Details | Review

Description Robin Stocker 2007-12-08 14:48:02 UTC
Subparse doesn't accept SubRip subtitles (.srt) where the index starts from 0 instead of 1. According to Wikipedia (http://en.wikipedia.org/wiki/SubRip), they should start from 1, but I've seen subtitles where index 0 was used for "credits".

To reproduce, put this into an srt file named the same as a movie:

0

00:00:00,000 --> 00:00:01,000

Test

Then try to play it with a player using GStreamer. Then change the 0 to 1 and try it again.

A user who doesn't know the SubRip format and tries to play a movie will be surprised that his subtitles aren't displayed, not knowing that he could edit the file and delete the entry with index 0 to make it work.

One solution would be a prominent FAQ entry somewhere. Another would be to make subparse recognise srt with index starting at 0. What do you think?
Comment 1 Robin Stocker 2007-12-08 14:52:03 UTC
Created attachment 100583 [details] [review]
make subparse recognise srt subtitles starting with index 0

This is a one line change to subrip_rx to additionally recognise 0 as an index.
Comment 2 Tim-Philipp Müller 2007-12-08 18:40:51 UTC
Thanks, should be fixed now:

 2007-12-08  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Robin Stocker <robin dot stocker at gmx dot ch>

        * gst/subparse/gstsubparse.c: (gst_sub_parse_data_format_autodetect):
          Some .srt files start with chunk number 0 and not chunk number 1,
          recognise and accept those as well (fixes #502497).

        * tests/check/elements/subparse.c: (srt_input), (srt_input0),
          (test_src):
          Add unit test for the above.

(I modified the patch slightly: it should be enough, and overall clearer, to just change [1-9] to [0-9].)