Nobody checks the return value of gst_pad_connect. This patch renames gst_pad_connect to gst_pad_try_connect and mak...

Original commit message from CVS:
Nobody checks the return value of gst_pad_connect.  This patch
renames gst_pad_connect to gst_pad_try_connect and makes
gst_pad_connect return void.
This commit is contained in:
Joshua N. Pritikin 2001-09-14 19:45:20 +00:00
parent d4fba8438b
commit 75a30f1f61
3 changed files with 23 additions and 3 deletions

View file

@ -187,7 +187,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
if (state == GST_STATE_PLAYING)
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PAUSED);
if ((connected = gst_pad_connect (pad, sinkpad))) {
if ((connected = gst_pad_try_connect (pad, sinkpad))) {
if (state == GST_STATE_PLAYING)
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PLAYING);
break;

View file

@ -555,9 +555,28 @@ gst_pad_disconnect (GstPad *srcpad,
*
* Returns: TRUE if the pad could be connected
*/
gboolean
void
gst_pad_connect (GstPad *srcpad,
GstPad *sinkpad)
{
if (!gst_pad_try_connect (srcpad, sinkpad))
g_critical ("couldn't connect %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (srcpad),
GST_DEBUG_PAD_NAME (sinkpad));
}
/**
* gst_pad_try_connect:
* @srcpad: the source pad to connect
* @sinkpad: the sink pad to connect
*
* Connects the source pad to the sink pad.
*
* Returns: TRUE if the pad could be connected
*/
gboolean
gst_pad_try_connect (GstPad *srcpad,
GstPad *sinkpad)
{
GstRealPad *realsrc, *realsink;
gboolean negotiated = FALSE;

View file

@ -336,7 +336,8 @@ GstPad* gst_pad_get_peer (GstPad *pad);
GstBufferPool* gst_pad_get_bufferpool (GstPad *pad);
gboolean gst_pad_connect (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_try_connect (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_connect (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_disconnect (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_renegotiate (GstPad *pad);