validate:tools: set locale to all and change argument to FILENAME
authorVineeth TM <vineeth.tm@samsung.com>
Tue, 11 Aug 2015 01:05:41 +0000 (10:05 +0900)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 2 Oct 2015 15:32:19 +0000 (17:32 +0200)
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
validate/tools/gst-validate-media-check.c
validate/tools/gst-validate-transcoding.c
validate/tools/gst-validate.c

index 0f52eaf..496b5d4 100644 (file)
@@ -25,6 +25,7 @@
 #include <gst/gst.h>
 #include <gst/validate/validate.h>
 #include <gst/video/video.h>
+#include <locale.h>             /* 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");
 
index 8b67823..ccf952f 100644 (file)
@@ -34,6 +34,7 @@
 #include <gst/validate/media-descriptor-parser.h>
 #include <gst/validate/media-descriptor.h>
 #include <gst/pbutils/encoding-profile.h>
+#include <locale.h>             /* 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 "
index ca15bea..96f2b93 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <locale.h>             /* for LC_ALL */
 
 #include <gst/gst.h>
 #include <gst/video/video.h>
@@ -815,7 +816,7 @@ main (int argc, gchar ** argv)
           "The presence property of the profile can be specified with |<presence>, eg:\n"
           "video/webm:video/x-vp8|<presence>: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++) {
index 994f36e..ddfe065 100644 (file)
@@ -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},