Added some caps != NULL checks.
authorErik Walthinsen <omega@temple-baptist.org>
Sun, 27 May 2001 23:57:34 +0000 (23:57 +0000)
committerErik Walthinsen <omega@temple-baptist.org>
Sun, 27 May 2001 23:57:34 +0000 (23:57 +0000)
Original commit message from CVS:
Added some caps != NULL checks.
Patched up a problem with the thread handling when the iteration fails.
Cleaned up the output of -inspect a tiny bit.

gst/elements/gstidentity.c
gst/gstpad.c
gst/gstthread.c
plugins/elements/gstidentity.c
tools/gstreamer-inspect.c

index 1e92dc5..2787fc0 100644 (file)
@@ -181,7 +181,8 @@ gst_identity_loop (GstElement *element)
   
   do {
     buf = gst_pad_pull (identity->sinkpad);
-    g_print("identity: ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(identity->sinkpad));
+    if (!identity->silent)
+      g_print("identity: ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(identity->sinkpad));
 
     gst_pad_push (identity->srcpad, buf);
 
index 16cae99..56dea94 100644 (file)
@@ -1304,6 +1304,7 @@ gst_pad_renegotiate (GstPad *pad)
     GST_DEBUG (GST_CAT_NEGOTIATION, "pads aggreed on caps :)\n");
 
   newcaps = GST_PAD_CAPS (pad);
+    g_return_val_if_fail(newcaps != NULL, FALSE);      // FIXME is this valid?
 
     /* here we have some sort of aggreement of the caps */
     GST_PAD_CAPS (currentpad) = gst_caps_ref (newcaps);
index 8f91ff3..e4fc66e 100644 (file)
@@ -552,8 +552,11 @@ gst_thread_main_loop (void *arg)
           // PLAYING is coming up, so we can now start spinning
           while (GST_FLAG_IS_SET (thread, GST_THREAD_STATE_SPINNING)) {
             if (!gst_bin_iterate (GST_BIN (thread))) {
-              GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
-              THR_DEBUG_MAIN("removed spinning state due to failed iteration!\n");
+//              GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
+//              THR_DEBUG_MAIN("removed spinning state due to failed iteration!\n");
+              // FIXME FIXME FIXME this is ugly!
+              THR_DEBUG_MAIN("iteration failed, something very wrong, spinning to let parent sync\n");
+              while (GST_FLAG_IS_SET(thread, GST_THREAD_STATE_SPINNING)) ;
             }
           }
           g_mutex_lock(thread->lock);
index 1e92dc5..2787fc0 100644 (file)
@@ -181,7 +181,8 @@ gst_identity_loop (GstElement *element)
   
   do {
     buf = gst_pad_pull (identity->sinkpad);
-    g_print("identity: ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(identity->sinkpad));
+    if (!identity->silent)
+      g_print("identity: ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(identity->sinkpad));
 
     gst_pad_push (identity->srcpad, buf);
 
index 81103f5..50b3c65 100644 (file)
@@ -36,7 +36,7 @@ void print_prop(GstPropsEntry *prop,gboolean showname,gchar *pfx) {
       printf("String: %s\n",prop->data.string_data.string);
       break;
     case GST_PROPS_FOURCC_ID:
-      printf("FourCC: %c%c%c%c\n",
+      printf("FourCC: '%c%c%c%c'\n",
              prop->data.fourcc_data & 0xff,prop->data.fourcc_data>>8 & 0xff,
              prop->data.fourcc_data>>16 & 0xff,prop->data.fourcc_data>>24 & 0xff);
       break;