muine r1181 - in trunk: . libmuine



Author: wbolster
Date: Mon Jun  9 16:55:37 2008
New Revision: 1181
URL: http://svn.gnome.org/viewvc/muine?rev=1181&view=rev

Log:
2008-06-09  Wouter Bolsterlee  <wbolster svn gnome org>

	* libmuine/player-gst.c (player_finalize), (bus_message_cb):

	Removed iterate_cb() function that didn't do anything
	but causing thousands of wakeups per second (according
	to powertop).



Modified:
   trunk/ChangeLog
   trunk/libmuine/player-gst.c

Modified: trunk/libmuine/player-gst.c
==============================================================================
--- trunk/libmuine/player-gst.c	(original)
+++ trunk/libmuine/player-gst.c	Mon Jun  9 16:55:37 2008
@@ -53,7 +53,6 @@
 	int	    cur_volume;
 	double      volume_scale;
 
-	guint       iterate_idle_id;
 	guint       tick_timeout_id;
 
 	GTimer     *timer;
@@ -180,8 +179,6 @@
 
 	g_timer_destroy (player->priv->timer);
 
-	if (player->priv->iterate_idle_id > 0)
-		g_source_remove (player->priv->iterate_idle_id);
 	if (player->priv->tick_timeout_id > 0)
 		g_source_remove (player->priv->tick_timeout_id);
 
@@ -222,24 +219,6 @@
 }
 
 static gboolean
-iterate_cb (Player *player)
-{
-	gboolean res;
-	GstState state;
-
-	g_usleep (100);
-	
-	gst_element_get_state (player->priv->play, &state, NULL, 0);
-	
-	res = (state == GST_STATE_PLAYING);
-
-	if (!res)
-		player->priv->iterate_idle_id = 0;
-
-	return res;
-}
-
-static gboolean
 bus_message_cb (GstBus *UNUSED(bus),
 		GstMessage *message,
 		gpointer data)
@@ -247,7 +226,6 @@
 	Player *player = (Player *) data;
 	char *debug;
 	GError *err;
-	GstState old_state, new_state;
 
 	switch (GST_MESSAGE_TYPE (message)) {
 	case GST_MESSAGE_ERROR:
@@ -270,19 +248,7 @@
 		break;
 
 	case GST_MESSAGE_STATE_CHANGED:
-		gst_message_parse_state_changed (message, &old_state, &new_state, NULL);
-		
-		if (old_state == GST_STATE_PLAYING) {
-			if (player->priv->iterate_idle_id != 0) {
-				g_source_remove (player->priv->iterate_idle_id);
-				player->priv->iterate_idle_id = 0;
-			}
-		} else if (new_state == GST_STATE_PLAYING) {
-			if (player->priv->iterate_idle_id != 0)
-				g_source_remove (player->priv->iterate_idle_id);
-			player->priv->iterate_idle_id = g_idle_add ((GSourceFunc) iterate_cb, player);
-		}
-
+		/* Do nothing */
 		break;
 
 	default:



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