From 89566bfc8aa8dbb699d35a784722b7f13f6c3e64 Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Mon, 28 Apr 2008 22:36:06 +0000 Subject: [MOVED FROM GST-P-FARSIGHT] Fix deadlock on invalid timestamp error 20080428223606-3e2dc-963e48b33efaf84c16d4ec4b789a6dfb2d9358ad.gz --- gst/liveadder/liveadder.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c index a6ae91a6..54a7f475 100644 --- a/gst/liveadder/liveadder.c +++ b/gst/liveadder/liveadder.c @@ -798,13 +798,8 @@ gst_live_live_adder_chain (GstPad *pad, GstBuffer *buffer) goto out; } - if (!GST_BUFFER_TIMESTAMP_IS_VALID(buffer)) { - GST_ELEMENT_ERROR (adder, STREAM, FAILED, - ("Buffer without a valid timestamp received"), ("")); - ret = GST_FLOW_ERROR; - gst_buffer_unref (buffer); - goto out; - } + if (!GST_BUFFER_TIMESTAMP_IS_VALID(buffer)) + goto invalid_timestamp; /* Just see if we receive invalid timestamp/durations */ if (GST_CLOCK_TIME_IS_VALID (padprivate->expected_timestamp) && @@ -972,6 +967,16 @@ gst_live_live_adder_chain (GstPad *pad, GstBuffer *buffer) gst_object_unref (adder); return ret; + + invalid_timestamp: + + GST_OBJECT_UNLOCK (adder); + gst_buffer_unref (buffer); + GST_ELEMENT_ERROR (adder, STREAM, FAILED, + ("Buffer without a valid timestamp received"), + ("Invalid timestamp received on buffer")); + + return GST_FLOW_ERROR; } /* -- cgit v1.2.1