GNOME Bugzilla – Bug 342235
add subtitle encoding in preference
Last modified: 2006-06-17 13:04:03 UTC
many subtitle format has no charset encoding information. so, totem shows broken subtitle. if there is some menu for subtitle encoding, this problem will be resolved. More info: In xine-lib, it can load subtitle encoding value ("subtitles.separate.src_encoding") via xine_config_lookup_entry() and can update via xine_config_update_entry(). and in gstreamer HEAD, it can change "encoding" property in subparse plugin. (bug 339520)
I found gstreamer backend use playbin plugin, not subparse. so, it can be resolved after add property in playbin plugin. add depend bug 342268.
Created attachment 65891 [details] [review] add subtitle encoding change api in bacon video widget add subtitle encoding change api in bacon video widget for gstreamer 0.10 and xine
Created attachment 65900 [details] [review] add encoding combobox in preference (glade) this is data/totem.glade patch for add subtitle encoding select ui
Created attachment 65901 [details] [review] add subtitle encoding menu in preference this is patch for subtitle encoding behavior. encoding list is copied from gnome-terminal :)
This looks good although: - we need the GStreamer patch to be merged before we can commit this - I'd rather the encoding.[ch] files be called totem-encoding.[ch], and that they be copied directly from gnome-terminal CVS (like the bacon-message-connection.[ch] and libegg files), to avoid having too much copied code.
Created attachment 65922 [details] [review] add subtitle encoding menu in preference rename encoding.[ch] to totem-encoding.[ch] as Bastien mentioned. move SubtitleEncoding and SubtitleEncodingIndex definition to totem-encoding.c cause they have no need to export. use strcasecmp() to compare charset instead of strcmp(). subtitle_encoding_create_store() returns sorted treemodel.
Created attachment 65925 [details] [review] add subtitle encoding menu in preference (gconf schemas) this is data/totem.schemas.in patch to adding /schemas/apps/totem/subtitle_encoding key. and make default key translatable.
Created attachment 65926 [details] [review] add subtitle encoding menu in preference (glade) use GtkTable instead of GtkVBox
Created attachment 66180 [details] [review] add subtitle encoding menu in preference add missing src/Makefile.am add missing po/POTFILES.in in find_encoding_by_charset(), check whether charset is NULL.
Created attachment 67077 [details] [review] add subtitle encoding menu in preference Changed combobox model to tree from list for grouping by language. I think it will be increase usability.
Comment on attachment 65891 [details] [review] add subtitle encoding change api in bacon video widget Committed with build fixes to the xine-lib backend. 2006-06-17 Bastien Nocera <hadess@hadess.net> * src/backend/bacon-video-widget-gst-0.10.c: (bacon_video_widget_set_subtitle_encoding): * src/backend/bacon-video-widget-xine.c: (bacon_video_widget_set_subtitle_encoding): * src/backend/bacon-video-widget.h: Patch from Young-Ho Cha <ganadist at chollian net>, to allow changing the default encoding for text subtitles
Comment on attachment 65926 [details] [review] add subtitle encoding menu in preference (glade) I just fixed the spacing in the .glade 2006-06-17 Bastien Nocera <hadess@hadess.net> * data/totem.glade: patch from Young-Ho Cha <ganadist at chollian net> to add a widget to select the text subtitles encoding * src/backend/bacon-video-widget-xine.c: (bacon_video_widget_set_subtitle_encoding): really fix build
Comment on attachment 65925 [details] [review] add subtitle encoding menu in preference (gconf schemas) Committed with a slightly better message for the translators. 2006-06-17 Bastien Nocera <hadess@hadess.net> * data/totem.schemas.in: patch from Young-Ho Cha <ganadist at chollian net> to add text subtitles encoding selection to GConf
A few changes to the patch committed: - changed the file names from totem-encoding to totem-subtitle-encoding - namespace the functions properly - make sure that we set UTF-8 as the encoding if there's no default in GConf - build and set the combobox in totem-subtitle-encoding Thanks for your work. 2006-06-17 Bastien Nocera <hadess@hadess.net> * src/Makefile.am: * src/backend/bacon-video-widget-xine.c: (bacon_video_widget_set_subtitle_encoding): lower-case the encoding string, as it's the way xine-lib expects it * src/totem-preferences.c: (on_encoding_set), (encoding_changed_cb), (totem_setup_preferences): * src/totem-subtitle-encoding.c: (find_encoding_by_charset), (subtitle_encoding_init), (subtitle_encoding_get_index), (subtitle_encoding_get_charset), (compare), (is_encoding_sensitive), (subtitle_encoding_create_store), (subtitle_encoding_combo_render), (totem_subtitle_encoding_get_selected), (totem_subtitle_encoding_set), (totem_subtitle_encoding_init): * src/totem-subtitle-encoding.h: * src/totem.c: Patch from Young-Ho Cha <ganadist at chollian net> to add subtitle selection to the Totem preferences (Closes: #342235) 2006-06-17 Bastien Nocera <hadess@hadess.net> * POTFILES.in: upd