GNOME Bugzilla – Bug 502497
[subparse] SubRip subtitles starting from 0 not recognised
Last modified: 2007-12-08 18:58:38 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?
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.
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].)