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 394061 - Add support for Subviewer subtitles
Add support for Subviewer subtitles
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.11
Other Linux
: Normal enhancement
: 0.10.14
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-07 22:40 UTC by Sven Arvidsson
Modified: 2007-06-05 21:35 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Crude attempt at adding SubViewer support (3.92 KB, patch)
2007-01-07 22:41 UTC, Sven Arvidsson
none Details | Review
subviewer.diff (8.75 KB, patch)
2007-05-24 19:46 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sven Arvidsson 2007-01-07 22:40:22 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?
Comment 1 Sven Arvidsson 2007-01-07 22:41:42 UTC
Created attachment 79688 [details] [review]
Crude attempt at adding SubViewer support
Comment 2 Sebastian Dröge (slomo) 2007-05-23 20:28:34 UTC
Looks good... thanks for your work :)

I'll take a much closer look after plugins-base is released and get it committed then.
Comment 3 Sebastian Dröge (slomo) 2007-05-24 09:00:38 UTC
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...
Comment 4 Sven Arvidsson 2007-05-24 12:29:56 UTC
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.
Comment 5 Sebastian Dröge (slomo) 2007-05-24 19:46:46 UTC
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.
Comment 6 Sebastian Dröge (slomo) 2007-05-24 19:51:25 UTC
If nobody has any objections I'll committ this after freeze...
Comment 7 Sebastian Dröge (slomo) 2007-06-05 21:35:25 UTC
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.