[snappy] engine: cast sink with gst_bin_get_by_interface ()



commit dbd9be0d311c4a6b9fab9b7c70d721b2a8fdf24c
Author: Luis de Bethencourt <luis debethencourt com>
Date:   Thu May 24 13:56:26 2012 +0100

    engine: cast sink with gst_bin_get_by_interface ()
    
    autovideosink can't be casted directly to GST_NAVIGATION, so need to use
    gst_bin_get_by_interface ()

 src/gst_engine.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/gst_engine.c b/src/gst_engine.c
index 2bbc38e..f4ec856 100644
--- a/src/gst_engine.c
+++ b/src/gst_engine.c
@@ -671,11 +671,8 @@ engine_init (GstEngine * engine, GstElement * sink)
 
   gchar *version_str;
 
-  version_str = gst_version_string ();
   GST_DEBUG_CATEGORY_INIT (_snappy_gst_debug, "snappy", 0,
       "snappy media player");
-  GST_DEBUG ("Initialised %s", version_str);
-  g_free (version_str);
 
   /* Make playbin2 element */
   engine->player = gst_element_factory_make ("playbin2", "playbin2");
@@ -689,7 +686,8 @@ engine_init (GstEngine * engine, GstElement * sink)
   g_object_set (G_OBJECT (engine->player), "video-sink", engine->sink, NULL);
   engine->bus = gst_pipeline_get_bus (GST_PIPELINE (engine->player));
 
-  engine->navigation = GST_NAVIGATION (engine->sink);
+  engine->navigation = GST_NAVIGATION (gst_bin_get_by_interface (GST_BIN (engine->player),
+                                                                 GST_TYPE_NAVIGATION));
 
   return TRUE;
 }



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