diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-07-05 15:41:20 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-07-16 09:47:34 +0200 |
commit | 39d9415d07d66c8de3318523f84b180fbfbbd4a3 (patch) | |
tree | 4b91eaf8d5f5d4d13636cb14995afb0e1a3d4ae9 /src | |
parent | e229771e8ca665d3f21994dbf7ee30b9ba4bac23 (diff) |
Don't set an audiosink on playbin for the preview and disable video output
This will make sure that the optimal audio sink is chosen and no video
is played whatsoever.
Diffstat (limited to 'src')
-rw-r--r-- | src/egg-play-preview.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/egg-play-preview.c b/src/egg-play-preview.c index 0d7c8c9..9c664d6 100644 --- a/src/egg-play-preview.c +++ b/src/egg-play-preview.c @@ -518,8 +518,8 @@ static void _setup_pipeline (EggPlayPreview *play_preview) { EggPlayPreviewPrivate *priv; - GstElement *audiosink; GstBus *bus = NULL; + guint flags; priv = GET_PRIVATE (play_preview); @@ -529,21 +529,14 @@ _setup_pipeline (EggPlayPreview *play_preview) if (!priv->playbin) return; - audiosink = gst_element_factory_make ("gconfaudiosink", "audiosink"); - if (!audiosink) { - audiosink = gst_element_factory_make ("autoaudiosink", "audiosink"); - if (!audiosink) { - audiosink = gst_element_factory_make ("alsasink", "audiosink"); - if (!audiosink) { - return; - } - } - } - + /* Disable video output */ + g_object_get (G_OBJECT (priv->playbin), + "flags", &flags, + NULL); + flags &= ~0x00000001; g_object_set (G_OBJECT (priv->playbin), - "audio-sink", audiosink, - "video-sink", NULL, - NULL); + "flags", flags, + NULL); bus = gst_pipeline_get_bus (GST_PIPELINE (priv->playbin)); gst_bus_add_watch (bus, (GstBusFunc) _process_bus_messages, play_preview); @@ -566,7 +559,7 @@ _clear_pipeline (EggPlayPreview *play_preview) gst_object_unref (bus); gst_element_set_state (priv->playbin, GST_STATE_NULL); - gst_object_unref (GST_OBJECT (priv->playbin)); + gst_object_unref (GST_OBJECT (priv->playbin)); priv->playbin = NULL; } } |