diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2010-03-07 07:11:13 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-29 23:36:24 +0800 |
commit | 49542a8ff607d5b1b60d14d3d34ebef943362778 (patch) | |
tree | c7fbbd50e4a6db3bbcf75e5c31ed1f37457febf8 | |
parent | 6f2876c2a265e4dbd968113795ec222dec86d008 (diff) | |
download | gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.tar gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.tar.gz gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.tar.bz2 gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.tar.lz gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.tar.xz gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.tar.zst gsoc2013-empathy-49542a8ff607d5b1b60d14d3d34ebef943362778.zip |
Add fakesink to srcpad if not real sink could be linked
-rw-r--r-- | src/empathy-call-window.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 2c2fa6264..0c9c9e3c4 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -2039,6 +2039,36 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler, out: + /* If no sink could be linked, try to add fakesink to prevent the whole call + * aborting */ + + if (!retval) + { + GstElement *fakesink = gst_element_factory_make ("fakesink", NULL); + + if (gst_bin_add (GST_BIN (priv->pipeline), fakesink)) + { + GstPad *sinkpad = gst_element_get_static_pad (fakesink, "sink"); + if (gst_element_set_state (fakesink, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE || + GST_PAD_LINK_FAILED (gst_pad_link (src, sinkpad))) + { + gst_element_set_locked_state (fakesink, TRUE); + gst_element_set_state (fakesink, GST_STATE_NULL); + gst_bin_remove (GST_BIN (priv->pipeline), fakesink); + } + else + { + g_debug ("Could not link real sink, linked fakesink instead"); + } + gst_object_unref (sinkpad); + } + else + { + gst_object_unref (fakesink); + } + } + + g_mutex_unlock (priv->lock); return TRUE; |