summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2009-08-05 11:49:39 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2009-08-06 14:03:45 +0100
commit8005bf0bdef75dfbc68f61ac76375b937bb3b18e (patch)
treef773f7ff9c66ed448954b90cf39bf5b9c749181b
parent5f3bb469be57aff749c16665df3196451883bad8 (diff)
downloadclutter-gst-8005bf0bdef75dfbc68f61ac76375b937bb3b18e.tar.gz
[player] Check the number of arguments after the initialization
If you want to give an option, say the --clutter-show-fps, to the video player, you have to wait until clutter_gst_init() parses the argument to checkout wether you have the <file> argument or not. While at it, swith to using clutter_gst_init().
-rw-r--r--examples/audio-player.c9
-rw-r--r--examples/video-player.c10
2 files changed, 10 insertions, 9 deletions
diff --git a/examples/audio-player.c b/examples/audio-player.c
index 796c7bb..613c9fa 100644
--- a/examples/audio-player.c
+++ b/examples/audio-player.c
@@ -32,15 +32,14 @@ main (int argc, char *argv[])
ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff };
ClutterGstAudio *audio;
+ clutter_gst_init (&argc, &argv);
+
if (argc < 2)
{
- g_error ("Usage: %s URI", argv[0]);
- return 1;
+ g_print ("Usage: [OPTIONS] %s URI\n", argv[0]);
+ return EXIT_FAILURE;
}
- clutter_init (&argc, &argv);
- gst_init (&argc, &argv);
-
stage = clutter_stage_get_default ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
diff --git a/examples/video-player.c b/examples/video-player.c
index 721014d..67b08ee 100644
--- a/examples/video-player.c
+++ b/examples/video-player.c
@@ -278,11 +278,13 @@ main (int argc, char *argv[])
ClutterColor control_color2 = { 0xcc, 0xcc, 0xcc, 0xff };
gfloat x,y;
- if (argc < 2)
- g_error("%s <video file>", argv[0]);
+ clutter_gst_init (&argc, &argv);
- clutter_init (&argc, &argv);
- gst_init (&argc, &argv);
+ if (argc < 2)
+ {
+ g_print ("Usage: %s [OPTIONS] <video file>\n", argv[0]);
+ return EXIT_FAILURE;
+ }
stage = clutter_stage_get_default ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);