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 552237 - UTF-16 srt confuses gstreamer, misdetected as mp3
UTF-16 srt confuses gstreamer, misdetected as mp3
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.x
Other Linux
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-14 15:40 UTC by Guillaume Desmottes
Modified: 2008-10-13 09:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bugged srt file (107.06 KB, text/plain)
2008-09-14 15:41 UTC, Guillaume Desmottes
Details

Description Guillaume Desmottes 2008-09-14 15:40:36 UTC
To reproduce:
- Take a video file, put the attached srt file in the same directory and rename it to the same name as the video (as foo.avi and foo.srt)
- Lauch totem, go to preferences and check if "Automatically load subtitle files when movie is loaded" is enabled
- Try to open the video
- Totem doesn't respond

I had the same problem with Elisa so I guess that's a GStreamer bug. The srt file is probably bugged but GStreamer should be able to handle it better. VLC was able to read it mostly fine (some subtitles were badly displayed).
Comment 1 Guillaume Desmottes 2008-09-14 15:41:40 UTC
Created attachment 118699 [details]
bugged srt file
Comment 2 Tim-Philipp Müller 2008-09-14 17:40:01 UTC
The file seems to be encoded in UTF-16(LE) with a BOM at the start. Three problems:

 - subparse doesn't handle files that are not UTF-8/ASCII yet
   (there's a bug for that somewhere I think) (or recognise
   them for that matter)

 - typefinding thinks it could be an mp3 because of the BOM marker

 - mp3parse doesn't error out after getting an EOS without having
   seen any frames. Guess it should post a STREAM WRONG_TYPE error
   or something like that in this case.
Comment 3 Sebastian Dröge (slomo) 2008-10-13 08:58:28 UTC
The first part is fixed now in CVS, I'll care for the other ones now ;)

2008-10-13  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

	* gst/subparse/Makefile.am:
	* gst/subparse/gstsubparse.c: (gst_sub_parse_dispose),
	(gst_sub_parse_class_init), (gst_sub_parse_init),
	(gst_convert_to_utf8), (detect_encoding), (convert_encoding),
	(get_next_line), (gst_sub_parse_data_format_autodetect),
	(feed_textbuf), (handle_buffer), (gst_sub_parse_change_state),
	(gst_subparse_type_find):
	* gst/subparse/gstsubparse.h:
	Add support for UTF16/UTF32 subtitles as long as the first bytes of
	the first buffer contain the BOM. This also adds support for other
	encodings that allow NUL bytes via the encoding property.
	Fixes bugs #552237 and #456788.
Comment 4 Sebastian Dröge (slomo) 2008-10-13 09:13:47 UTC
2008-10-13  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

	* gst/mpegaudioparse/gstmpegaudioparse.c:
	(gst_mp3parse_sink_event):
	Post a GST_ELEMENT_ERROR if we get EOS before seeing any valid
	frames. Partially fixes bug #552237.


IMHO the typefinding is a non-issue now and I don't see how to fix it properly. The mp3 typefinder found at least two following valid frame headers in this file ;)