gst-plugins-base: streamsynchronizer: force fallback buffer_alloc when other pad not available

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Tue Jan 3 02:12:39 PST 2012


Module: gst-plugins-base
Branch: master
Commit: 3e0d35aec41ad63b978a8c7be62dfb37fdd93650
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=3e0d35aec41ad63b978a8c7be62dfb37fdd93650

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Tue Jan  3 11:04:23 2012 +0100

streamsynchronizer: force fallback buffer_alloc when other pad not available

... to avoid unnecessary spurious errors (upon e.g. shutdown).
If a real error is applicable in this unusual circumstance (missing other pad),
other (STREAM_LOCK protected) call paths can take care of that.

---

 gst/playback/gststreamsynchronizer.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c
index 3f2b8a8..b71dcb3 100644
--- a/gst/playback/gststreamsynchronizer.c
+++ b/gst/playback/gststreamsynchronizer.c
@@ -565,7 +565,7 @@ gst_stream_synchronizer_sink_bufferalloc (GstPad * pad, guint64 offset,
     guint size, GstCaps * caps, GstBuffer ** buf)
 {
   GstPad *opad;
-  GstFlowReturn ret = GST_FLOW_ERROR;
+  GstFlowReturn ret = GST_FLOW_OK;
 
   GST_LOG_OBJECT (pad, "Allocating buffer: size=%u", size);
 
@@ -573,6 +573,10 @@ gst_stream_synchronizer_sink_bufferalloc (GstPad * pad, guint64 offset,
   if (opad) {
     ret = gst_pad_alloc_buffer (opad, offset, size, caps, buf);
     gst_object_unref (opad);
+  } else {
+    /* may have been released during shutdown;
+     * silently trigger fallback */
+    *buf = NULL;
   }
 
   GST_LOG_OBJECT (pad, "Allocation: %s", gst_flow_get_name (ret));



More information about the gstreamer-commits mailing list