[totem] backend: Remove non-PulseAudio sink hacks



commit 1cc2837529e84401a9e93f33cc0c5eaaac6fec3d
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Apr 11 14:02:04 2012 +0100

    backend: Remove non-PulseAudio sink hacks
    
    The goal of the original patch was to make Totem's audio output code
    not wake up on a regular basis, as the audio device was still opened.
    Now that PulseAudio is used pretty much everywhere we care about, remove
    that code, and simplify the logic.
    
    Revert "Only set playbin2 to NULL on errors or after 10 seconds of doing nothing"
    
    This reverts commit 14b0c9e7ca8472fadf59a77bbb43786ee94b72b1.
    
    Conflicts:
    
    	src/backend/bacon-video-widget-gst-0.10.c

 src/backend/bacon-video-widget-gst-0.10.c |   40 +---------------------------
 1 files changed, 2 insertions(+), 38 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 43a5ff1..5b963c8 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -174,7 +174,6 @@ struct BaconVideoWidgetPrivate
 
   guint                        update_id;
   guint                        fill_id;
-  guint                        ready_idle_id;
 
   GdkPixbuf                   *logo_pixbuf;
   GdkPixbuf                   *cover_pixbuf; /* stream-specific image */
@@ -2571,11 +2570,6 @@ bacon_video_widget_finalize (GObject * object)
     bvw->priv->source = NULL;
   }
 
-  if (bvw->priv->ready_idle_id) {
-    g_source_remove (bvw->priv->ready_idle_id);
-    bvw->priv->ready_idle_id = 0;
-  }
-
   if (bvw->priv->play != NULL && GST_IS_ELEMENT (bvw->priv->play)) {
     gst_element_set_state (bvw->priv->play, GST_STATE_NULL);
     gst_object_unref (bvw->priv->play);
@@ -3476,11 +3470,6 @@ bacon_video_widget_open (BaconVideoWidget * bvw,
   bvw->priv->media_has_audio = FALSE;
   bvw->priv->stream_length = 0;
 
-  if (bvw->priv->ready_idle_id) {
-    g_source_remove (bvw->priv->ready_idle_id);
-    bvw->priv->ready_idle_id = 0;
-  }
-
   /* Flush the bus to make sure we don't get any messages
    * from the previous URI, see bug #607224.
    */
@@ -3496,6 +3485,7 @@ bacon_video_widget_open (BaconVideoWidget * bvw,
   g_object_set (bvw->priv->play, "uri", bvw->priv->mrl,
                 "suburi", subtitle_uri, NULL);
 
+
   bvw->priv->seekable = -1;
   bvw->priv->target_state = GST_STATE_PAUSED;
   bvw_clear_missing_plugins_messages (bvw);
@@ -3529,11 +3519,6 @@ bacon_video_widget_play (BaconVideoWidget * bvw, GError ** error)
   g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE);
   g_return_val_if_fail (bvw->priv->mrl != NULL, FALSE);
 
-  if (bvw->priv->ready_idle_id) {
-    g_source_remove (bvw->priv->ready_idle_id);
-    bvw->priv->ready_idle_id = 0;
-  }
-
   bvw->priv->target_state = GST_STATE_PLAYING;
 
   /* Don't try to play if we're already doing that */
@@ -3752,17 +3737,6 @@ bacon_video_widget_step (BaconVideoWidget *bvw, gboolean forward, GError **error
   return retval;
 }
 
-static gboolean
-_ready_idle_cb (gpointer data)
-{
-  GstElement *playbin = GST_ELEMENT (data);
-
-  GST_DEBUG ("setting playbin to NULL");
-  gst_element_set_state (playbin, GST_STATE_NULL);
-
-  return FALSE;
-}
-
 static void
 bvw_stop_play_pipeline (BaconVideoWidget * bvw)
 {
@@ -3793,13 +3767,8 @@ bvw_stop_play_pipeline (BaconVideoWidget * bvw)
   gst_object_unref (bus);
 
   /* Now in READY or lower */
-  if (bvw->priv->ready_idle_id) {
-    g_source_remove (bvw->priv->ready_idle_id);
-    bvw->priv->ready_idle_id = 0;
-  }
-  bvw->priv->ready_idle_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 10, _ready_idle_cb, gst_object_ref (bvw->priv->play), (GDestroyNotify) gst_object_unref);
-
   bvw->priv->target_state = GST_STATE_READY;
+
   bvw->priv->buffering = FALSE;
   bvw->priv->plugin_install_in_progress = FALSE;
   bvw->priv->download_buffering = FALSE;
@@ -4135,11 +4104,6 @@ bacon_video_widget_pause (BaconVideoWidget * bvw)
     return;
   }
 
-  if (bvw->priv->ready_idle_id) {
-    g_source_remove (bvw->priv->ready_idle_id);
-    bvw->priv->ready_idle_id = 0;
-  }
-
   GST_LOG ("Pausing");
   bvw->priv->target_state = GST_STATE_PAUSED;
   gst_element_set_state (GST_ELEMENT (bvw->priv->play), GST_STATE_PAUSED);



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