validate:tools: set locale to all and change argument to FILENAME

When file name consists of characters from other languages, say korean,
then it throws an error
Error initializing: Invalid byte sequence in conversion input

Hence setting locale to all to fix this.
And changing the media-info argument to type G_OPTION_ARG_FILENAME

https://bugzilla.gnome.org/show_bug.cgi?id=752945
This commit is contained in:
Vineeth TM 2015-07-29 16:42:48 +09:00 committed by Tim-Philipp Müller
parent df76ce5812
commit c91ed016b1

View file

@ -38,6 +38,7 @@
#ifdef G_OS_UNIX #ifdef G_OS_UNIX
#include <glib-unix.h> #include <glib-unix.h>
#endif #endif
#include <locale.h> /* for LC_ALL */
static gint ret = 0; static gint ret = 0;
static GMainLoop *mainloop; static GMainLoop *mainloop;
@ -432,7 +433,7 @@ main (int argc, gchar ** argv)
" if no parameter passed, it will list all avalaible action types" " if no parameter passed, it will list all avalaible action types"
" otherwize will print the full description of the wanted types", " otherwize will print the full description of the wanted types",
NULL}, NULL},
{"set-media-info", '\0', 0, G_OPTION_ARG_STRING, &media_info, {"set-media-info", '\0', 0, G_OPTION_ARG_FILENAME, &media_info,
"Set a media_info XML file descriptor to share information about the" "Set a media_info XML file descriptor to share information about the"
" media file that will be reproduced.", " media file that will be reproduced.",
NULL}, NULL},
@ -449,6 +450,8 @@ main (int argc, gchar ** argv)
GstValidateMonitor *monitor; GstValidateMonitor *monitor;
GstBus *bus; GstBus *bus;
setlocale (LC_ALL, "");
g_set_prgname ("gst-validate-" GST_API_VERSION); g_set_prgname ("gst-validate-" GST_API_VERSION);
ctx = g_option_context_new ("PIPELINE-DESCRIPTION"); ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
g_option_context_add_main_entries (ctx, options, NULL); g_option_context_add_main_entries (ctx, options, NULL);