GNOME Bugzilla – Bug 690097
resindvd: Handle non-utf8 dvd title string correctly
Last modified: 2013-01-07 23:43:42 UTC
gst-launch playbin2 uri=dvd:// When playing a DVD with non-utf8 title string, a runtime warning thrown: "GStreamer-WARNING **: Trying to set string on taglist field 'title', but string is not valid UTF-8. Please file a bug." Warning likely from this code in gst-plugins-bad/ext/resindvd resindvdsrc.c:881 GstTagList *tags = gst_tag_list_new (GST_TAG_TITLE, title_str, NULL); In such DVDs, the "DVD Menu, <dvd name>" title is not known to the playbin2 elements. So, there is no way for other elements to know when the dvd menu is open. A possible fix for this issue, is to replace non-utf8 chars with '?' in the disc_name/dvd-title. diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c index f13418a..5b3ef7e 100644 --- a/ext/resindvd/resindvdsrc.c +++ b/ext/resindvd/resindvdsrc.c @@ -399,6 +399,11 @@ rsn_dvdsrc_start (GstBaseSrc * bsrc) dvdnav_get_title_string (src->dvdnav, &src->disc_name); + /* ensure the disc name is a valid utf8 string */ + const gchar* end = NULL; + while (g_utf8_validate(src->disc_name, -1, &end) == FALSE && end) + *((gchar*)end) = '?'; + src->first_seek = TRUE; src->running = TRUE; src->branching = FALSE;
Thanks for the bug report and the patch. Let's try this instead, which should hopefully work in more cases: commit 4c76427ba778da3f7491de6b9fd57db3021a9e09 Author: Tim-Philipp Müller <tim@centricular.net> Date: Mon Jan 7 10:37:53 2013 +0000 resindvd: handle non-utf8 dvd disc titles better Maybe something based on the code in bug #688367 and the language encodings would work even better though (now it will try things based on the locale). https://bugzilla.gnome.org/show_bug.cgi?id=690097