[totem] Disable video decoding in audio mode



commit 1b62a9c299b71a4173a65ac7116ccc62a5bb0702
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Nov 16 15:03:39 2009 +0000

    Disable video decoding in audio mode
    
    So as to get some more free CPU cycles, and avoid errors
    during video decoding.

 src/backend/bacon-video-widget-gst-0.10.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 9ce7e3f..be796fe 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -6693,9 +6693,18 @@ bacon_video_widget_new (int width, int height,
 
   bvw->priv->bus = gst_element_get_bus (bvw->priv->play);
 
-  /* Add the download flag, for streaming buffering */
-  g_object_get (bvw->priv->play, "flags", &flags, NULL);
-  g_object_set (bvw->priv->play, "flags", flags | GST_PLAY_FLAGS_DOWNLOAD, NULL);
+  /* Add the download flag, for streaming buffering, for video only */
+  if (type == BVW_USE_TYPE_VIDEO) {
+    g_object_get (bvw->priv->play, "flags", &flags, NULL);
+    g_object_set (bvw->priv->play, "flags", flags | GST_PLAY_FLAGS_DOWNLOAD, NULL);
+  }
+
+  /* Disable video decoding in audio mode */
+  if (type == BVW_USE_TYPE_AUDIO) {
+    g_object_get (bvw->priv->play, "flags", &flags, NULL);
+    flags &= ~GST_PLAY_FLAGS_VIDEO;
+    g_object_set (bvw->priv->play, "flags", flags, NULL);
+  }
 
   gst_bus_add_signal_watch (bvw->priv->bus);
 



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