seek: set selected/default audio/video sinks on playbin and playbin2
authorVladimir Eremeev <eremeev@atlantis.ru>
Mon, 27 Sep 2010 09:32:31 +0000 (13:32 +0400)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 25 May 2011 18:36:02 +0000 (19:36 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=630322

tests/examples/seek/seek.c

index 459ea30..d79209c 100644 (file)
@@ -930,6 +930,7 @@ static GstElement *
 construct_playerbin (const gchar * name, const gchar * location)
 {
   GstElement *player;
+  GstElement *avsink;
 
   player = gst_element_factory_make (name, "player");
   g_assert (player);
@@ -941,6 +942,14 @@ construct_playerbin (const gchar * name, const gchar * location)
   /* force element seeking on this pipeline */
   elem_seek = TRUE;
 
+  avsink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink");
+  if (avsink)
+    g_object_set (player, "audio-sink", avsink, NULL);
+
+  avsink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink");
+  if (avsink)
+    g_object_set (player, "video-sink", avsink, NULL);
+
   return player;
 }