r9353 - in packages/trunk/wesnoth/debian: . patches

Gerfried Fuchs alfie at alioth.debian.org
Thu Apr 2 10:14:32 UTC 2009


Author: alfie
Date: 2009-04-02 10:14:31 +0000 (Thu, 02 Apr 2009)
New Revision: 9353

Added:
   packages/trunk/wesnoth/debian/patches/03no-music-endless-loop
Modified:
   packages/trunk/wesnoth/debian/changelog
   packages/trunk/wesnoth/debian/patches/02wesnoth-nolog-desktop-file
   packages/trunk/wesnoth/debian/patches/series
Log:
wesnoth (1:1.6a-3) unstable; urgency=medium
 * Pull fix for endless loop consuming 100% CPU when no music is installed
   from upstream r34257.


Modified: packages/trunk/wesnoth/debian/changelog
===================================================================
--- packages/trunk/wesnoth/debian/changelog	2009-04-02 03:58:59 UTC (rev 9352)
+++ packages/trunk/wesnoth/debian/changelog	2009-04-02 10:14:31 UTC (rev 9353)
@@ -1,3 +1,10 @@
+wesnoth (1:1.6a-3) unstable; urgency=medium
+
+  * Pull fix for endless loop consuming 100% CPU when no music is installed
+    from upstream r34257.
+
+ -- Gerfried Fuchs <rhonda at debian.at>  Thu, 02 Apr 2009 12:06:45 +0200
+
 wesnoth (1:1.6a-2) unstable; urgency=medium
 
   * Install the menu icons from the icons subdirectory instead of symlinking

Modified: packages/trunk/wesnoth/debian/patches/02wesnoth-nolog-desktop-file
===================================================================
--- packages/trunk/wesnoth/debian/patches/02wesnoth-nolog-desktop-file	2009-04-02 03:58:59 UTC (rev 9352)
+++ packages/trunk/wesnoth/debian/patches/02wesnoth-nolog-desktop-file	2009-04-02 10:14:31 UTC (rev 9353)
@@ -1,13 +1,13 @@
 Author: Gerfried Fuchs <rhonda at debian.at>	vim:ft=diff:
 Description: call wesnoth-nolog from desktop file, too
 
-Index: wesnoth-1.5.11/icons/wesnoth.desktop
+Index: wesnoth-1.6a/icons/wesnoth.desktop
 ===================================================================
---- wesnoth-1.5.11.orig/icons/wesnoth.desktop
-+++ wesnoth-1.5.11/icons/wesnoth.desktop
-@@ -44,6 +44,6 @@ Comment[sk]=Ťahová strategická hra z 
- Comment[sr]=Фантазијска стратешка игра на потезе
+--- wesnoth-1.6a.orig/icons/wesnoth.desktop
++++ wesnoth-1.6a/icons/wesnoth.desktop
+@@ -53,6 +53,6 @@ Comment[sr]=Фантазијска стÑ
  Comment[sr at latin]=Fantazijska strateška igra na poteze
+ Comment[tr]=Fantastik, sırayla oynanan bir strateji oyunu
  Icon=wesnoth-icon.png
 -Exec=wesnoth
 +Exec=wesnoth-nolog

Added: packages/trunk/wesnoth/debian/patches/03no-music-endless-loop
===================================================================
--- packages/trunk/wesnoth/debian/patches/03no-music-endless-loop	                        (rev 0)
+++ packages/trunk/wesnoth/debian/patches/03no-music-endless-loop	2009-04-02 10:14:31 UTC (rev 9353)
@@ -0,0 +1,88 @@
+Author: shadowmaster	vim:ft=diff:
+Description: avoid an infinite loop when no music playlist entries are
+   valid (upstream bug #13250, upstream svn r34257)
+
+Index: wesnoth-1.6a/src/sound.cpp
+===================================================================
+--- wesnoth-1.6a.orig/src/sound.cpp
++++ wesnoth-1.6a/src/sound.cpp
+@@ -138,6 +138,8 @@ std::list< sound_cache_chunk > sound_cac
+ typedef std::list< sound_cache_chunk >::iterator sound_cache_iterator;
+ std::map<std::string,Mix_Music*> music_cache;
+ 
++struct no_valid_tracks {};
++
+ struct music_track
+ {
+ 	music_track(const std::string &tname);
+@@ -186,6 +188,9 @@ struct music_track last_track("");
+ 
+ static bool track_ok(const std::string &name)
+ {
++	if(name.empty()) {
++		return false;
++	}
+ 	LOG_AUDIO << "Considering " << name << "\n";
+ 
+ 	// If they committed changes to list, we forget previous plays, but
+@@ -246,6 +251,17 @@ static const music_track &choose_track()
+ {
+ 	assert(!current_track_list.empty());
+ 
++	bool all_invalid = true;
++	foreach(const music_track& mt, current_track_list) {
++		if(!mt.name.empty()) {
++			all_invalid = false;
++			break;
++		}
++	}
++	if(all_invalid) {
++		throw no_valid_tracks();
++	}
++
+ 	std::string name;
+ 	unsigned int track = 0;
+ 
+@@ -607,23 +623,28 @@ void play_music_config(const config &mus
+ 
+ void music_thinker::process(events::pump_info &info) {
+ 	if(preferences::music_on()) {
+-		if(!music_start_time && !current_track_list.empty() && !Mix_PlayingMusic()) {
+-			// Pick next track, add ending time to its start time.
+-			current_track = choose_track();
+-			music_start_time = info.ticks();
+-			no_fading=true;
+-			fadingout_time=0;
+-		}
++		try {
++			if(!music_start_time && !current_track_list.empty() && !Mix_PlayingMusic()) {
++				// Pick next track, add ending time to its start time.
++				current_track = choose_track();
++				music_start_time = info.ticks();
++				no_fading=true;
++				fadingout_time=0;
++			}
+ 
+-		if(music_start_time && info.ticks(&music_refresh, music_refresh_rate) >= music_start_time - fadingout_time) {
+-			want_new_music=true;
+-		}
++			if(music_start_time && info.ticks(&music_refresh, music_refresh_rate) >= music_start_time - fadingout_time) {
++				want_new_music=true;
++			}
+ 
+-		if(want_new_music) {
+-			if(Mix_PlayingMusic()) {
+-				Mix_FadeOutMusic(fadingout_time);
++			if(want_new_music) {
++				if(Mix_PlayingMusic()) {
++					Mix_FadeOutMusic(fadingout_time);
++				}
++				play_new_music();
+ 			}
+-			play_new_music();
++		}
++		catch(no_valid_tracks const&) {
++			current_track_list.clear();
+ 		}
+ 	}
+ }

Modified: packages/trunk/wesnoth/debian/patches/series
===================================================================
--- packages/trunk/wesnoth/debian/patches/series	2009-04-02 03:58:59 UTC (rev 9352)
+++ packages/trunk/wesnoth/debian/patches/series	2009-04-02 10:14:31 UTC (rev 9353)
@@ -1 +1,2 @@
 02wesnoth-nolog-desktop-file
+03no-music-endless-loop




More information about the Pkg-games-commits mailing list