unref events free buffer in vorbisfile if it cannot be pushed
authorWim Taymans <wim.taymans@gmail.com>
Mon, 8 Jul 2002 19:38:26 +0000 (19:38 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 8 Jul 2002 19:38:26 +0000 (19:38 +0000)
Original commit message from CVS:
unref events
free buffer in vorbisfile if it cannot be pushed

ext/sidplay/gstsiddec.cc

index 5b1f41f..222e64a 100644 (file)
@@ -362,6 +362,8 @@ gst_siddec_loop (GstElement *element)
     g_assert (buf != NULL);
       
     if (GST_IS_EVENT (buf)) {
+      GstEvent *event = GST_EVENT (buf);
+
       switch (GST_EVENT_TYPE (buf)) {
        case GST_EVENT_EOS:
           siddec->state = SID_STATE_LOAD_TUNE;
@@ -370,10 +372,12 @@ gst_siddec_loop (GstElement *element)
          break;
        default:
          // bail out, we're not going to do anything
+          gst_event_unref (event);
          gst_pad_send_event (siddec->srcpad, gst_event_new (GST_EVENT_EOS));
          gst_element_set_eos (element);
-         break;
+         return;
       }
+      gst_event_unref (event);
     }
     else {
       memcpy (siddec->tune_buffer+siddec->tune_len, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));