Mercurial > audlegacy
comparison src/audacious/playlist.c @ 2670:84a10fce92a1 trunk
[svn] - playlist_set_info() does not change the playlist and shouldn't block
author | nenolod |
---|---|
date | Tue, 10 Apr 2007 11:25:39 -0700 |
parents | 0b4949cad842 |
children | e9b379528fbc |
comparison
equal
deleted
inserted
replaced
2669:0b4949cad842 | 2670:84a10fce92a1 |
---|---|
1045 playlist_set_info_old_abi(const gchar * title, gint length, gint rate, | 1045 playlist_set_info_old_abi(const gchar * title, gint length, gint rate, |
1046 gint freq, gint nch) | 1046 gint freq, gint nch) |
1047 { | 1047 { |
1048 Playlist *playlist = playlist_get_active(); | 1048 Playlist *playlist = playlist_get_active(); |
1049 | 1049 |
1050 PLAYLIST_LOCK(playlist->mutex); | |
1051 | |
1052 g_return_if_fail(playlist != NULL); | 1050 g_return_if_fail(playlist != NULL); |
1053 | 1051 |
1054 if (playlist->position) { | 1052 if (playlist->position) { |
1055 g_free(playlist->position->title); | 1053 g_free(playlist->position->title); |
1056 playlist->position->title = g_strdup(title); | 1054 playlist->position->title = g_strdup(title); |
1063 } | 1061 } |
1064 playlist->position->tuple->track_name = g_strdup(title); | 1062 playlist->position->tuple->track_name = g_strdup(title); |
1065 } | 1063 } |
1066 } | 1064 } |
1067 | 1065 |
1068 PLAYLIST_UNLOCK(playlist->mutex); | |
1069 | |
1070 playlist_recalc_total_time(playlist); | 1066 playlist_recalc_total_time(playlist); |
1071 | 1067 |
1072 mainwin_set_song_info(rate, freq, nch); | 1068 mainwin_set_song_info(rate, freq, nch); |
1073 | 1069 |
1074 if ( playlist->position ) | 1070 if ( playlist->position ) |
1077 | 1073 |
1078 void | 1074 void |
1079 playlist_set_info(Playlist * playlist, const gchar * title, gint length, gint rate, | 1075 playlist_set_info(Playlist * playlist, const gchar * title, gint length, gint rate, |
1080 gint freq, gint nch) | 1076 gint freq, gint nch) |
1081 { | 1077 { |
1082 PLAYLIST_LOCK(playlist->mutex); | |
1083 | |
1084 g_return_if_fail(playlist != NULL); | 1078 g_return_if_fail(playlist != NULL); |
1085 | 1079 |
1086 if (playlist->position) { | 1080 if (playlist->position) { |
1087 g_free(playlist->position->title); | 1081 g_free(playlist->position->title); |
1088 playlist->position->title = g_strdup(title); | 1082 playlist->position->title = g_strdup(title); |
1089 playlist->position->length = length; | 1083 playlist->position->length = length; |
1090 } | 1084 } |
1091 | |
1092 PLAYLIST_UNLOCK(playlist->mutex); | |
1093 | 1085 |
1094 playlist_recalc_total_time(playlist); | 1086 playlist_recalc_total_time(playlist); |
1095 | 1087 |
1096 mainwin_set_song_info(rate, freq, nch); | 1088 mainwin_set_song_info(rate, freq, nch); |
1097 | 1089 |