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 690097 - resindvd: Handle non-utf8 dvd title string correctly
resindvd: Handle non-utf8 dvd title string correctly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.0.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-12 13:10 UTC by Sundararaj
Modified: 2013-01-07 23:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sundararaj 2012-12-12 13:10:12 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;
Comment 1 Tim-Philipp Müller 2013-01-07 11:47:03 UTC
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