GNOME Bugzilla – Bug 394061
Add support for Subviewer subtitles
Last modified: 2007-06-05 21:35:25 UTC
Support for Subviewer (version 1 & 2) would be great to have. Subviewer is a time based external subtitle format similar to SubRip. Here's a short sample, copied from http://www.doom9.org/index.html?/sub.htm The only difference between the two versions is linebreaks indicated by [br]. [INFORMATION] [TITLE]xxxxxxxxxx [AUTHOR]xxxxxxxx [SOURCE]xxxxxxxxxxxxxxxx [FILEPATH] [DELAY]0 [COMMENT] [END INFORMATION] [SUBTITLE] [COLF]&HFFFFFF,[STYLE]bd,[SIZE]18,[FONT]Arial 00:00:41.00,00:00:44.40 The Age of Gods was closing. Eternity had come to an end. 00:00:55.00,00:00:58.40 The heavens shook as the armies of Falis, God of Light... I have made a very crude attempt at adding support for version 1, but I'm guessing a rewrite is both needed and easier to do. Maybe this bug could be tagged for GNOME Love?
Created attachment 79688 [details] [review] Crude attempt at adding SubViewer support
Looks good... thanks for your work :) I'll take a much closer look after plugins-base is released and get it committed then.
Adding version 2 support should probably be as easy as replacing all occurences of "[br]" with "\n" in the subtitle text I guess? Apart from that this patch is IMHO perfect already :) I'll add the version 2 support soon and get it committed after release...
Great! The patch was almost entirely a cut and paste job from the subrip code, so I wasn't sure if it was good enough.
Created attachment 88761 [details] [review] subviewer.diff Ok, here is it with version 2 support, stripping of trailing newlines and two unit tests, one for version 1 and one for version 2.
If nobody has any objections I'll committ this after freeze...
2007-06-05 Sebastian Dröge <slomo@circular-chaos.org> Based on a patch by Sven Arvidsson <sa at whiz dot se>: * gst/subparse/gstsubparse.c: (parse_subrip), (subviewer_unescape_newlines), (parse_subviewer), (gst_sub_parse_data_format_autodetect), (gst_sub_parse_format_autodetect), (gst_subparse_type_find): * gst/subparse/gstsubparse.h: Add support for SubViewer version 1 and 2 subtitles. Fixes #394061. * tests/check/elements/subparse.c: (GST_START_TEST), (subparse_suite): Add a unit test for both SubViewer formats.