From 8f039997f097ac5baa6a59350b2d41942a13232e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 17 Nov 2010 01:01:03 +0000 Subject: [PATCH] playbin2: disable streamsynchronizer magic for this release Some things aren't quite right yet and cause problems (0-sized buffers with PREROLL flag set cause crashes in elements that don't expect those; getting pipeline back to preroll/playing again when audio/video streams have different lengths and a seek past the end of one of the stream happens doesn't always work, etc.). Needs further investigation in the next cycle. https://bugzilla.gnome.org/show_bug.cgi?id=633700 https://bugzilla.gnome.org/show_bug.cgi?id=634699 --- gst/playback/gststreamsynchronizer.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 10cf2815d5..0114a252b3 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -52,6 +52,8 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%d", GST_PAD_REQUEST, GST_STATIC_CAPS_ANY); +static const gboolean passthrough = TRUE; + GST_BOILERPLATE (GstStreamSynchronizer, gst_stream_synchronizer, GstElement, GST_TYPE_ELEMENT); @@ -190,6 +192,9 @@ gst_stream_synchronizer_src_event (GstPad * pad, GstEvent * event) GstPad *opad; gboolean ret = FALSE; + if (passthrough) + goto skip_adjustments; + GST_LOG_OBJECT (pad, "Handling event %s: %" GST_PTR_FORMAT, GST_EVENT_TYPE_NAME (event), event->structure); @@ -242,6 +247,8 @@ gst_stream_synchronizer_src_event (GstPad * pad, GstEvent * event) break; } +skip_adjustments: + opad = gst_stream_get_other_pad_from_pad (pad); if (opad) { ret = gst_pad_push_event (opad, event); @@ -263,6 +270,9 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event) GstPad *opad; gboolean ret = FALSE; + if (passthrough) + goto skip_adjustments; + GST_LOG_OBJECT (pad, "Handling event %s: %" GST_PTR_FORMAT, GST_EVENT_TYPE_NAME (event), event->structure); @@ -521,6 +531,8 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event) break; } +skip_adjustments: + opad = gst_stream_get_other_pad_from_pad (pad); if (opad) { ret = gst_pad_push_event (opad, event); @@ -564,6 +576,15 @@ gst_stream_synchronizer_sink_chain (GstPad * pad, GstBuffer * buffer) GstClockTime timestamp = GST_CLOCK_TIME_NONE; GstClockTime timestamp_end = GST_CLOCK_TIME_NONE; + if (passthrough) { + opad = gst_stream_get_other_pad_from_pad (pad); + if (opad) { + ret = gst_pad_push (opad, buffer); + gst_object_unref (opad); + } + goto done; + } + GST_LOG_OBJECT (pad, "Handling buffer %p: size=%u, timestamp=%" GST_TIME_FORMAT " duration=%" GST_TIME_FORMAT " offset=%" G_GUINT64_FORMAT " offset_end=%" G_GUINT64_FORMAT, @@ -661,6 +682,8 @@ gst_stream_synchronizer_sink_chain (GstPad * pad, GstBuffer * buffer) GST_STREAM_SYNCHRONIZER_UNLOCK (self); } +done: + gst_object_unref (self); return ret;