From 5c0c42ed6d8c26c19e90fb3a0f8e347141f79db3 Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Tue, 11 Aug 2015 10:05:41 +0900 Subject: 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=753486 --- validate/tools/gst-validate-images-check.c | 5 ++++- validate/tools/gst-validate-media-check.c | 2 ++ validate/tools/gst-validate-transcoding.c | 4 +++- validate/tools/gst-validate.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/validate/tools/gst-validate-images-check.c b/validate/tools/gst-validate-images-check.c index 0f52eaf..496b5d4 100644 --- a/validate/tools/gst-validate-images-check.c +++ b/validate/tools/gst-validate-images-check.c @@ -25,6 +25,7 @@ #include #include #include +#include /* for LC_ALL */ int main (int argc, char **argv) @@ -49,7 +50,7 @@ main (int argc, char **argv) "The minimum 'lowest' similarity under which we consider" "the test as failing", NULL}, - {"result-output-folder", 'r', 0, G_OPTION_ARG_STRING, + {"result-output-folder", 'r', 0, G_OPTION_ARG_FILENAME, &outfolder, "The folder in which to store resulting grey scale images" " when the test failed. In that folder you will find" @@ -59,6 +60,8 @@ main (int argc, char **argv) {NULL} }; + setlocale (LC_ALL, ""); + g_set_prgname ("gst-validate-mages-check-" GST_API_VERSION); ctx = g_option_context_new ("/reference/file/path /compared/file/path"); diff --git a/validate/tools/gst-validate-media-check.c b/validate/tools/gst-validate-media-check.c index 8b67823..ccf952f 100644 --- a/validate/tools/gst-validate-media-check.c +++ b/validate/tools/gst-validate-media-check.c @@ -34,6 +34,7 @@ #include #include #include +#include /* for LC_ALL */ int main (int argc, gchar ** argv) @@ -64,6 +65,7 @@ main (int argc, gchar ** argv) {NULL} }; + setlocale (LC_ALL, ""); g_set_prgname ("gst-validate-media-check-" GST_API_VERSION); ctx = g_option_context_new ("[URI]"); g_option_context_set_summary (ctx, "Analyzes a media file and writes " diff --git a/validate/tools/gst-validate-transcoding.c b/validate/tools/gst-validate-transcoding.c index ca15bea..96f2b93 100644 --- a/validate/tools/gst-validate-transcoding.c +++ b/validate/tools/gst-validate-transcoding.c @@ -27,6 +27,7 @@ #include #include +#include /* for LC_ALL */ #include #include @@ -815,7 +816,7 @@ main (int argc, gchar ** argv) "The presence property of the profile can be specified with |, eg:\n" "video/webm:video/x-vp8|:audio/x-vorbis\n", "properties-values"}, - {"set-scenario", '\0', 0, G_OPTION_ARG_STRING, &scenario, + {"set-scenario", '\0', 0, G_OPTION_ARG_FILENAME, &scenario, "Let you set a scenario, it can be a full path to a scenario file" " or the name of the scenario (name of the file without the" " '.scenario' extension).", NULL}, @@ -846,6 +847,7 @@ main (int argc, gchar ** argv) {NULL} }; + setlocale (LC_ALL, ""); /* There is a bug that make gst_init remove the help param when initializing, * it is FIXED in 1.0 */ for (i = 1; i < argc; i++) { diff --git a/validate/tools/gst-validate.c b/validate/tools/gst-validate.c index 994f36e..ddfe065 100644 --- a/validate/tools/gst-validate.c +++ b/validate/tools/gst-validate.c @@ -442,7 +442,7 @@ main (int argc, gchar ** argv) int rep_err; GOptionEntry options[] = { - {"set-scenario", '\0', 0, G_OPTION_ARG_STRING, &scenario, + {"set-scenario", '\0', 0, G_OPTION_ARG_FILENAME, &scenario, "Let you set a scenario, it can be a full path to a scenario file" " or the name of the scenario (name of the file without the" " '.scenario' extension).", NULL}, -- cgit v1.2.3