1 |
jdhore 12/05/27 21:00:17 |
2 |
|
3 |
Added: audacious-3.2.3-fix-mutex.patch |
4 |
Log: |
5 |
Version bump and cleanups. |
6 |
|
7 |
(Portage version: 2.2.0_alpha108/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-sound/audacious/files/audacious-3.2.3-fix-mutex.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/audacious/files/audacious-3.2.3-fix-mutex.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/audacious/files/audacious-3.2.3-fix-mutex.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: audacious-3.2.3-fix-mutex.patch |
16 |
=================================================================== |
17 |
commit b53935921298b8164f80454c2016bd40de29704b |
18 |
Author: John Lindgren <john.lindgren@×××.com> |
19 |
Date: Sat May 26 11:55:42 2012 -0400 |
20 |
|
21 |
Fix violation of mutex locking order (playback then playlist). Found by Helgrind. |
22 |
|
23 |
diff --git a/src/audacious/playlist-new.c b/src/audacious/playlist-new.c |
24 |
index 6407f64..596fbaa 100644 |
25 |
--- a/src/audacious/playlist-new.c |
26 |
+++ b/src/audacious/playlist-new.c |
27 |
@@ -822,6 +822,7 @@ void playlist_reorder (int from, int to, int count) |
28 |
|
29 |
void playlist_delete (int playlist_num) |
30 |
{ |
31 |
+ /* stop playback before locking playlists */ |
32 |
if (playback_get_playing () && playlist_num == playlist_get_playing ()) |
33 |
playback_stop (); |
34 |
|
35 |
@@ -969,6 +970,7 @@ int playlist_get_active (void) |
36 |
|
37 |
void playlist_set_playing (int playlist_num) |
38 |
{ |
39 |
+ /* stop playback before locking playlists */ |
40 |
if (playback_get_playing ()) |
41 |
playback_stop (); |
42 |
|
43 |
@@ -1112,6 +1114,7 @@ void playlist_entry_insert_batch_raw (int playlist_num, int at, |
44 |
|
45 |
void playlist_entry_delete (int playlist_num, int at, int number) |
46 |
{ |
47 |
+ /* stop playback before locking playlists */ |
48 |
if (playback_get_playing () && playlist_num == playlist_get_playing () && |
49 |
playlist_get_position (playlist_num) >= at && playlist_get_position |
50 |
(playlist_num) < at + number) |
51 |
@@ -1225,6 +1228,7 @@ int playlist_entry_get_length (int playlist_num, int entry_num, bool_t fast) |
52 |
|
53 |
void playlist_set_position (int playlist_num, int entry_num) |
54 |
{ |
55 |
+ /* stop playback before locking playlists */ |
56 |
if (playback_get_playing () && playlist_num == playlist_get_playing ()) |
57 |
playback_stop (); |
58 |
|
59 |
@@ -1423,6 +1427,7 @@ int playlist_shift (int playlist_num, int entry_num, int distance) |
60 |
|
61 |
void playlist_delete_selected (int playlist_num) |
62 |
{ |
63 |
+ /* stop playback before locking playlists */ |
64 |
if (playback_get_playing () && playlist_num == playlist_get_playing () && |
65 |
playlist_get_position (playlist_num) >= 0 && playlist_entry_get_selected |
66 |
(playlist_num, playlist_get_position (playlist_num))) |
67 |
@@ -2023,6 +2028,7 @@ static bool_t shuffle_prev (Playlist * playlist) |
68 |
|
69 |
bool_t playlist_prev_song (int playlist_num) |
70 |
{ |
71 |
+ /* stop playback before locking playlists */ |
72 |
if (playback_get_playing () && playlist_num == playlist_get_playing ()) |
73 |
playback_stop (); |
74 |
|
75 |
@@ -2110,6 +2116,7 @@ static void shuffle_reset (Playlist * playlist) |
76 |
|
77 |
bool_t playlist_next_song (int playlist_num, bool_t repeat) |
78 |
{ |
79 |
+ /* stop playback before locking playlists */ |
80 |
if (playback_get_playing () && playlist_num == playlist_get_playing ()) |
81 |
playback_stop (); |
82 |
|
83 |
@@ -2253,6 +2260,11 @@ int playback_entry_get_end_time (void) |
84 |
|
85 |
void playlist_save_state (void) |
86 |
{ |
87 |
+ /* get playback state before locking playlists */ |
88 |
+ resume_state = playback_get_playing () ? (playback_get_paused () ? |
89 |
+ RESUME_PAUSE : RESUME_PLAY) : RESUME_STOP; |
90 |
+ resume_time = playback_get_playing () ? playback_get_time () : 0; |
91 |
+ |
92 |
ENTER; |
93 |
|
94 |
char * path = g_strdup_printf ("%s/" STATE_FILE, get_path (AUD_PATH_USER_DIR)); |
95 |
@@ -2261,10 +2273,6 @@ void playlist_save_state (void) |
96 |
if (! handle) |
97 |
LEAVE_RET_VOID; |
98 |
|
99 |
- resume_state = playback_get_playing () ? (playback_get_paused () ? |
100 |
- RESUME_PAUSE : RESUME_PLAY) : RESUME_STOP; |
101 |
- resume_time = playback_get_playing () ? playback_get_time () : 0; |
102 |
- |
103 |
fprintf (handle, "resume-state %d\n", resume_state); |
104 |
fprintf (handle, "resume-time %d\n", resume_time); |