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
This commit is contained in:
Tim-Philipp Müller 2013-01-07 10:37:53 +00:00
parent 8436a7d8ae
commit 4c76427ba7
3 changed files with 12 additions and 2 deletions

View file

@ -18,6 +18,7 @@ $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_CFLAGS) $(DVDNAV_CFLAGS) $(GST_CFLAGS) $(DVDNAV_CFLAGS)
libgstresindvd_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ libgstresindvd_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
-lgstvideo-$(GST_API_VERSION) -lgstpbutils-$(GST_API_VERSION) \ -lgstvideo-$(GST_API_VERSION) -lgstpbutils-$(GST_API_VERSION) \
-lgsttag-$(GST_API_VERSION) \
$(GST_BASE_LIBS) $(GST_LIBS) $(GMODULE_NO_EXPORT_LIBS) $(DVDNAV_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(GMODULE_NO_EXPORT_LIBS) $(DVDNAV_LIBS)
libgstresindvd_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstresindvd_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstresindvd_la_LIBTOOLFLAGS = --tag=disable-static libgstresindvd_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -30,6 +30,7 @@
#include <gst/gst-i18n-plugin.h> #include <gst/gst-i18n-plugin.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/video/navigation.h> #include <gst/video/navigation.h>
#include <gst/tag/tag.h>
#include "resindvdsrc.h" #include "resindvdsrc.h"
@ -351,6 +352,7 @@ rsn_dvdsrc_start (GstBaseSrc * bsrc)
{ {
resinDvdSrc *src = RESINDVDSRC (bsrc); resinDvdSrc *src = RESINDVDSRC (bsrc);
const gchar *const *langs, *const *cur; const gchar *const *langs, *const *cur;
const char *disc_name;
gchar lang[8]; gchar lang[8];
g_mutex_lock (src->dvd_lock); 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->first_seek = TRUE;
src->running = TRUE; src->running = TRUE;
@ -576,6 +584,7 @@ rsn_dvdsrc_stop (GstBaseSrc * bsrc)
src->highlight_event = NULL; src->highlight_event = NULL;
} }
g_free (src->disc_name);
src->disc_name = NULL; src->disc_name = NULL;
if (src->dvdnav) { if (src->dvdnav) {

View file

@ -58,7 +58,7 @@ struct _resinDvdSrc
gchar *device; gchar *device;
dvdnav_t *dvdnav; 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 instance is used to load and cache VTS/VMG ifo info */
dvd_reader_t *dvdread; dvd_reader_t *dvdread;