[empathy] Drop EOS from the src



commit ab7098222f1b01f87956331ae7c1e095fbf1c9a5
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Fri Nov 4 18:45:22 2011 +0000

    Drop EOS from the src

 src/empathy-video-src.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c
index 9d0ee02..e284211 100644
--- a/src/empathy-video-src.c
+++ b/src/empathy-video-src.c
@@ -111,6 +111,11 @@ error:
   return NULL;
 }
 
+static gboolean
+empathy_video_src_drop_eos (GstPad *pad, GstEvent *event, gpointer user_data)
+{
+  return GST_EVENT_TYPE (event) != GST_EVENT_EOS;
+}
 
 static void
 empathy_video_src_init (EmpathyGstVideoSrc *obj)
@@ -135,6 +140,12 @@ empathy_video_src_init (EmpathyGstVideoSrc *obj)
   /* we need to save our source to priv->src */
   priv->src = element;
 
+  /* Drop EOS events, so that our sinks don't get confused when we restart the
+   * source (triggering an EOS) */
+  src = gst_element_get_static_pad (element, "src");
+  gst_pad_add_event_probe (src, G_CALLBACK (empathy_video_src_drop_eos), NULL);
+  gst_object_unref (src);
+
   /* videomaxrate is optional as it's part of gst-plugins-bad. So don't
    * fail if it doesn't exist. */
   element_back = element;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]