queue2: handle CAPS event and drop it if operating in ring buffer mode
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 17 Jul 2012 18:20:23 +0000 (19:20 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 17 Jul 2012 18:27:44 +0000 (19:27 +0100)
Fixes "Unexpected event of kind caps can't be added in temp file"
warning when doing download buffering.

plugins/elements/gstqueue2.c

index 581ec55..206285f 100644 (file)
@@ -1923,6 +1923,19 @@ gst_queue2_locked_enqueue (GstQueue2 * queue, gpointer item,
           item = NULL;
         }
         break;
+      case GST_EVENT_CAPS:{
+        GstCaps *caps;
+
+        gst_event_parse_caps (event, &caps);
+        GST_INFO ("got caps: %" GST_PTR_FORMAT, caps);
+
+        if (!QUEUE_IS_USING_QUEUE (queue)) {
+          GST_LOG ("Dropping caps event, not using queue");
+          gst_event_unref (event);
+          item = NULL;
+        }
+        break;
+      }
       default:
         if (!QUEUE_IS_USING_QUEUE (queue))
           goto unexpected_event;