From 3116198fc37c831499fc178d471bb73465071b72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 8 Jul 2009 17:02:54 +0200 Subject: [PATCH] gio: Improve the error message if a stream is already closed before usage --- ext/gio/gstgiobasesink.c | 4 ++++ ext/gio/gstgiobasesrc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ext/gio/gstgiobasesink.c b/ext/gio/gstgiobasesink.c index 39d76cd..6a87871 100644 --- a/ext/gio/gstgiobasesink.c +++ b/ext/gio/gstgiobasesink.c @@ -119,6 +119,10 @@ gst_gio_base_sink_start (GstBaseSink * base_sink) GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, (NULL), ("No output stream provided by subclass")); return FALSE; + } else if (G_UNLIKELY (g_output_stream_is_closed (sink->stream))) { + GST_ELEMENT_ERROR (sink, LIBRARY, FAILED, (NULL), + ("Output stream is already closed")); + return FALSE; } GST_DEBUG_OBJECT (sink, "started sink"); diff --git a/ext/gio/gstgiobasesrc.c b/ext/gio/gstgiobasesrc.c index 6ef4190..cfeab57 100644 --- a/ext/gio/gstgiobasesrc.c +++ b/ext/gio/gstgiobasesrc.c @@ -130,6 +130,10 @@ gst_gio_base_src_start (GstBaseSrc * base_src) GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), ("No input stream provided by subclass")); return FALSE; + } else if (G_UNLIKELY (g_input_stream_is_closed (src->stream))) { + GST_ELEMENT_ERROR (src, LIBRARY, FAILED, (NULL), + ("Input stream is already closed")); + return FALSE; } GST_DEBUG_OBJECT (src, "started source"); -- 2.7.4