r20948 - in /packages/unstable/rhythmbox/debian: changelog patches/ patches/01_repeat_all_with_one_song.patch rules

pochu-guest at users.alioth.debian.org pochu-guest at users.alioth.debian.org
Sun Aug 16 22:11:51 UTC 2009


Author: pochu-guest
Date: Sun Aug 16 22:11:51 2009
New Revision: 20948

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=20948
Log:
debian/patches/01_repeat_all_with_one_song.patch: backport from
upstream git, keep playing when the playlist contains a single song
and repeat is enabled.

Added:
    packages/unstable/rhythmbox/debian/patches/
    packages/unstable/rhythmbox/debian/patches/01_repeat_all_with_one_song.patch
Modified:
    packages/unstable/rhythmbox/debian/changelog
    packages/unstable/rhythmbox/debian/rules

Modified: packages/unstable/rhythmbox/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/rhythmbox/debian/changelog?rev=20948&op=diff
==============================================================================
--- packages/unstable/rhythmbox/debian/changelog [utf-8] (original)
+++ packages/unstable/rhythmbox/debian/changelog [utf-8] Sun Aug 16 22:11:51 2009
@@ -2,6 +2,9 @@
 
   * debian/NEWS: mention that the tray icon is now a plugin. Closes:
     #537137, #539612.
+  * debian/patches/01_repeat_all_with_one_song.patch: backport from
+    upstream git, keep playing when the playlist contains a single song
+    and repeat is enabled.
 
  -- Emilio Pozuelo Monfort <pochu at ubuntu.com>  Sun, 02 Aug 2009 16:20:56 +0200
 

Added: packages/unstable/rhythmbox/debian/patches/01_repeat_all_with_one_song.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/rhythmbox/debian/patches/01_repeat_all_with_one_song.patch?rev=20948&op=file
==============================================================================
--- packages/unstable/rhythmbox/debian/patches/01_repeat_all_with_one_song.patch (added)
+++ packages/unstable/rhythmbox/debian/patches/01_repeat_all_with_one_song.patch [utf-8] Sun Aug 16 22:11:51 2009
@@ -1,0 +1,83 @@
+From b5d091c1d615c87936a1280b7a74c376e4e8847d Mon Sep 17 00:00:00 2001
+From: Jonathan Matthew <jonathan at d14n.org>
+Date: Fri, 14 Aug 2009 11:52:01 +0000
+Subject: make random play orders pick an entry when total weight is 0 (bug #580440)
+
+If there are entries in the query model, but they all have a weight of
+0, it's better to pick one at random than to return nothing.  This
+specifically fixes single track playlists with random-by-age-and-weight,
+but it makes sense in general.
+---
+diff --git a/shell/rb-play-order-random.c b/shell/rb-play-order-random.c
+index 8c31ed4..d3103ef 100644
+--- a/shell/rb-play-order-random.c
++++ b/shell/rb-play-order-random.c
+@@ -164,22 +164,24 @@ get_query_model_contents (RBRandomPlayOrder *rorder, RhythmDBQueryModel *model)
+ 	double weight = 0.0;
+ 	double cumulative_weight = 0.0;
+ 	GtkTreeIter iter;
+-	GArray *result = g_array_new (FALSE, FALSE, sizeof (EntryWeight));
++	GArray *result;
+ 
+-	if (model == NULL)
+-		return result;
++	if (model == NULL) {
++		return NULL;
++	}
+ 
+ 	num_entries = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (model), NULL);
+-	if (num_entries == 0)
+-		return result;
+-
+-	g_array_set_size (result, num_entries);
+-	db = rb_play_order_get_db (RB_PLAY_ORDER (rorder));
++	if (num_entries == 0) {
++		return NULL;
++	}
+ 
+ 	if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter))
+-		return result;
++		return NULL;
+ 
+ 	i = 0;
++	result = g_array_new (FALSE, FALSE, sizeof (EntryWeight));
++	g_array_set_size (result, num_entries);
++	db = rb_play_order_get_db (RB_PLAY_ORDER (rorder));
+ 	do {
+ 		RhythmDBEntry *entry = rhythmdb_query_model_iter_to_entry (model, &iter);
+ 
+@@ -274,12 +276,20 @@ rb_random_play_order_pick_entry (RBRandomPlayOrder *rorder)
+ 	RhythmDBQueryModel *model;
+ 
+ 	model = rb_play_order_get_query_model (RB_PLAY_ORDER (rorder));
+-
+ 	entry_weights = get_query_model_contents (rorder, model);
++	if (entry_weights == NULL) {
++		rb_debug ("nothing to choose from");
++		return NULL;
++	}
+ 
+ 	total_weight = rb_random_get_total_weight (entry_weights);
+-	if (total_weight == 0.0)
+-		return NULL;
++	if (total_weight == 0.0) {
++		low = g_random_int_range (0, entry_weights->len);
++		rb_debug ("total weight is 0; picked entry %d of %d randomly", low, entry_weights->len);
++		entry = g_array_index (entry_weights, EntryWeight, low).entry;
++		g_array_free (entry_weights, TRUE);
++		return entry;
++	}
+ 
+ 	rnd = g_random_double_range (0, total_weight);
+ 	/* Binary search for the entry with cumulative weight closest to but
+@@ -293,6 +303,8 @@ rb_random_play_order_pick_entry (RBRandomPlayOrder *rorder)
+ 			low = mid;
+ 	}
+ 	entry = g_array_index (entry_weights, EntryWeight, low).entry;
++	rb_debug ("picked entry %d of %d (total weight %f) for random value %f",
++		  low, entry_weights->len, total_weight, rnd);
+ 
+ 	g_array_free (entry_weights, TRUE);
+ 
+--
+cgit v0.8.2

Modified: packages/unstable/rhythmbox/debian/rules
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/rhythmbox/debian/rules?rev=20948&op=diff
==============================================================================
--- packages/unstable/rhythmbox/debian/rules [utf-8] (original)
+++ packages/unstable/rhythmbox/debian/rules [utf-8] Sun Aug 16 22:11:51 2009
@@ -7,11 +7,8 @@
 include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
 -include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
 
-# lirc support
 DEB_CONFIGURE_EXTRA_FLAGS += --enable-lirc
-# disable scrollkeeper-update in make install
 DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper
-# use iceape to build the plugin
 DEB_CONFIGURE_EXTRA_FLAGS += --with-gecko=iceape
 
 # exclude plugins from shlibs generation




More information about the pkg-gnome-commits mailing list