fakesrc: fix use of empty subbuffers
authorStefan Kost <ensonic@users.sf.net>
Thu, 2 Sep 2010 11:15:29 +0000 (14:15 +0300)
committerStefan Kost <ensonic@users.sf.net>
Thu, 2 Sep 2010 11:19:24 +0000 (14:19 +0300)
Remove a short cut that was ignoring src->data allocation mode. All
the called code-path below handle size==0.

plugins/elements/gstfakesrc.c

index 1594f5d..e82bfb6 100644 (file)
@@ -717,13 +717,9 @@ static GstBuffer *
 gst_fake_src_create_buffer (GstFakeSrc * src)
 {
   GstBuffer *buf;
-  guint size;
+  guint size = gst_fake_src_get_size (src);
   gboolean dump = src->dump;
 
-  size = gst_fake_src_get_size (src);
-  if (size == 0)
-    return gst_buffer_new ();
-
   switch (src->data) {
     case FAKE_SRC_DATA_ALLOCATE:
       buf = gst_fake_src_alloc_buffer (src, size);