diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2013-01-07 10:37:53 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-01-07 10:37:53 +0000 |
commit | 4c76427ba778da3f7491de6b9fd57db3021a9e09 (patch) | |
tree | 1ad57e57f7314189202a67ff786a15ef7cb7217e /ext/resindvd | |
parent | 8436a7d8ae5d5ec47fccb2d667355da40fddcd09 (diff) | |
download | gstreamer-plugins-bad-4c76427ba778da3f7491de6b9fd57db3021a9e09.tar.gz |
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
Diffstat (limited to 'ext/resindvd')
-rw-r--r-- | ext/resindvd/Makefile.am | 1 | ||||
-rw-r--r-- | ext/resindvd/resindvdsrc.c | 11 | ||||
-rw-r--r-- | ext/resindvd/resindvdsrc.h | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/ext/resindvd/Makefile.am b/ext/resindvd/Makefile.am index bc51f9b13..1dceac6c2 100644 --- a/ext/resindvd/Makefile.am +++ b/ext/resindvd/Makefile.am @@ -18,6 +18,7 @@ $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \ $(GST_CFLAGS) $(DVDNAV_CFLAGS) libgstresindvd_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ -lgstvideo-$(GST_API_VERSION) -lgstpbutils-$(GST_API_VERSION) \ +-lgsttag-$(GST_API_VERSION) \ $(GST_BASE_LIBS) $(GST_LIBS) $(GMODULE_NO_EXPORT_LIBS) $(DVDNAV_LIBS) libgstresindvd_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstresindvd_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c index f13418a13..cb43e2a67 100644 --- a/ext/resindvd/resindvdsrc.c +++ b/ext/resindvd/resindvdsrc.c @@ -30,6 +30,7 @@ #include <gst/gst-i18n-plugin.h> #include <gst/video/video.h> #include <gst/video/navigation.h> +#include <gst/tag/tag.h> #include "resindvdsrc.h" @@ -351,6 +352,7 @@ rsn_dvdsrc_start (GstBaseSrc * bsrc) { resinDvdSrc *src = RESINDVDSRC (bsrc); const gchar *const *langs, *const *cur; + const char *disc_name; gchar lang[8]; g_mutex_lock (src->dvd_lock); @@ -397,7 +399,13 @@ rsn_dvdsrc_start (GstBaseSrc * bsrc) } } - dvdnav_get_title_string (src->dvdnav, &src->disc_name); + /* Get disc name and convert to UTF-8 */ + g_free (src->disc_name); + dvdnav_get_title_string (src->dvdnav, &disc_name); + if (disc_name != NULL && *disc_name != '\0') + src->disc_name = gst_tag_freeform_string_to_utf8 (disc_name, -1, NULL); + else + src->disc_name = NULL; src->first_seek = TRUE; src->running = TRUE; @@ -576,6 +584,7 @@ rsn_dvdsrc_stop (GstBaseSrc * bsrc) src->highlight_event = NULL; } + g_free (src->disc_name); src->disc_name = NULL; if (src->dvdnav) { diff --git a/ext/resindvd/resindvdsrc.h b/ext/resindvd/resindvdsrc.h index e53fb2b12..5804c07b2 100644 --- a/ext/resindvd/resindvdsrc.h +++ b/ext/resindvd/resindvdsrc.h @@ -58,7 +58,7 @@ struct _resinDvdSrc gchar *device; dvdnav_t *dvdnav; - const char *disc_name; + gchar *disc_name; /* dvd_reader instance is used to load and cache VTS/VMG ifo info */ dvd_reader_t *dvdread; |