[0.11] gst-plugins-good: matroskamux: Update for the new collectpads2 event handling API

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Jan 26 01:46:18 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: a54c4d6bc4463beb2dbf263546f76606cfa0878f
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=a54c4d6bc4463beb2dbf263546f76606cfa0878f

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Thu Jan 26 10:37:52 2012 +0100

matroskamux: Update for the new collectpads2 event handling API

---

 gst/matroska/matroska-mux.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index 5515c24..b193eca 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -735,6 +735,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
   GstMatroskaMux *mux;
   GstPad *pad;
   GstTagList *list;
+  gboolean ret = FALSE;
 
   mux = GST_MATROSKA_MUX (user_data);
   collect_pad = (GstMatroskaPad *) data;
@@ -749,7 +750,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
       collect_pad = (GstMatroskaPad *) gst_pad_get_element_private (pad);
       gst_event_parse_caps (event, &caps);
 
-      collect_pad->capsfunc (pad, caps);
+      ret = collect_pad->capsfunc (pad, caps);
       gst_event_unref (event);
       event = NULL;
       break;
@@ -781,6 +782,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
       gst_event_unref (event);
       /* handled this, don't want collectpads to forward it downstream */
       event = NULL;
+      ret = TRUE;
       break;
     }
     case GST_EVENT_SEGMENT:{
@@ -788,9 +790,11 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
 
       gst_event_parse_segment (event, &segment);
       if (segment->format != GST_FORMAT_TIME) {
-        gst_event_unref (event);
-        event = NULL;
+        ret = FALSE;
       }
+      gst_event_unref (event);
+      event = NULL;
+      ret = TRUE;
       break;
     }
     case GST_EVENT_CUSTOM_DOWNSTREAM:{
@@ -827,14 +831,18 @@ gst_matroska_mux_handle_sink_event (GstCollectPads2 * pads,
         /* transform into private data for stream; text form */
         gst_matroska_mux_build_vobsub_private (context, clut);
       }
-      break;
     }
+      /* fall through */
     default:
+      ret = gst_pad_event_default (data->pad, GST_OBJECT (mux), event);
+      break;
+    case GST_EVENT_EOS:
+      gst_event_unref (event);
+      ret = TRUE;
       break;
   }
 
-  /* now GstCollectPads2 can take care of the rest, e.g. EOS */
-  return (event == NULL);
+  return ret;
 }
 
 static void



More information about the gstreamer-commits mailing list