examples/retag/retag.c: Call gst_init before processing program args. Add g_assert...
authorColin Walters <walters@verbum.org>
Sun, 18 Jan 2004 18:48:44 +0000 (18:48 +0000)
committerColin Walters <walters@verbum.org>
Sun, 18 Jan 2004 18:48:44 +0000 (18:48 +0000)
Original commit message from CVS:
2004-01-18  Colin Walters  <walters@verbum.org>

* examples/retag/retag.c: Call gst_init before processing
program args.  Add g_assert to _link_many call.

ChangeLog
examples/retag/retag.c
tests/old/examples/retag/retag.c

index 7699750..167c66f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-18  Colin Walters  <walters@verbum.org>
+
+       * examples/retag/retag.c: Call gst_init before processing
+       program args.  Add g_assert to _link_many call.
+
 2004-01-16  Benjamin Otte  <in7y118@public.uni-hamburg.de>
 
        * gst/gstpad.c: (gst_pad_alloc_buffer):
index 2824ba7..8ab3fb9 100644 (file)
@@ -21,15 +21,15 @@ main (int argc, char *argv[])
   GstElement *bin, *filesrc, *tag_changer, *filesink;
   gchar *artist, *title, *ext, *filename;
   
+  /* initialize GStreamer */
+  gst_init (&argc, &argv);
+
   /* check that the argument is there */
   if (argc != 2) {
     g_print ("usage: %s <mp3 file>\n", argv[0]);
     return 1;
   }
 
-  /* initialize GStreamer */
-  gst_init (&argc, &argv);
-
   /* parse the mp3 name */
   artist = strrchr (argv[1], '/');
   if (artist == NULL)
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
   gst_bin_add_many (GST_BIN (bin), filesrc, tag_changer, filesink, NULL);
 
   /* link the elements */
-  gst_element_link_many (filesrc, tag_changer, filesink, NULL);
+  g_assert (gst_element_link_many (filesrc, tag_changer, filesink));
   
   /* start playing */
   gst_element_set_state (bin, GST_STATE_PLAYING);
index 2824ba7..8ab3fb9 100644 (file)
@@ -21,15 +21,15 @@ main (int argc, char *argv[])
   GstElement *bin, *filesrc, *tag_changer, *filesink;
   gchar *artist, *title, *ext, *filename;
   
+  /* initialize GStreamer */
+  gst_init (&argc, &argv);
+
   /* check that the argument is there */
   if (argc != 2) {
     g_print ("usage: %s <mp3 file>\n", argv[0]);
     return 1;
   }
 
-  /* initialize GStreamer */
-  gst_init (&argc, &argv);
-
   /* parse the mp3 name */
   artist = strrchr (argv[1], '/');
   if (artist == NULL)
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
   gst_bin_add_many (GST_BIN (bin), filesrc, tag_changer, filesink, NULL);
 
   /* link the elements */
-  gst_element_link_many (filesrc, tag_changer, filesink, NULL);
+  g_assert (gst_element_link_many (filesrc, tag_changer, filesink));
   
   /* start playing */
   gst_element_set_state (bin, GST_STATE_PLAYING);