comparison src/audacious/playlist.c @ 2671:e9b379528fbc trunk

[svn] - playlist_get_length_nolock() -> playlist_get_length(), no need for locking here.
author nenolod
date Tue, 10 Apr 2007 11:27:26 -0700
parents 84a10fce92a1
children d2ffabee3ced
comparison
equal deleted inserted replaced
2670:84a10fce92a1 2671:e9b379528fbc
1110 if (playlistwin_item_visible(pos)) { 1110 if (playlistwin_item_visible(pos)) {
1111 PLAYLIST_UNLOCK(playlist->mutex); 1111 PLAYLIST_UNLOCK(playlist->mutex);
1112 return; 1112 return;
1113 } 1113 }
1114 1114
1115 bottom = MAX(0, playlist_get_length_nolock(playlist) - 1115 bottom = MAX(0, playlist_get_length(playlist) -
1116 playlistwin_list->pl_num_visible); 1116 playlistwin_list->pl_num_visible);
1117 row = CLAMP(pos - playlistwin_list->pl_num_visible / 2, 0, bottom); 1117 row = CLAMP(pos - playlistwin_list->pl_num_visible / 2, 0, bottom);
1118 PLAYLIST_UNLOCK(playlist->mutex); 1118 PLAYLIST_UNLOCK(playlist->mutex);
1119 playlistwin_set_toprow(row); 1119 playlistwin_set_toprow(row);
1120 g_cond_signal(cond_scan); 1120 g_cond_signal(cond_scan);
1489 mainwin_set_info_text(); 1489 mainwin_set_info_text();
1490 playlistwin_update_list(playlist); 1490 playlistwin_update_list(playlist);
1491 } 1491 }
1492 1492
1493 gint 1493 gint
1494 playlist_queue_get_length(Playlist *playlist)
1495 {
1496 gint length;
1497
1498 PLAYLIST_LOCK(playlist->mutex);
1499 length = g_list_length(playlist->queue);
1500 PLAYLIST_UNLOCK(playlist->mutex);
1501
1502 return length;
1503 }
1504
1505 gint
1494 playlist_get_length(Playlist *playlist) 1506 playlist_get_length(Playlist *playlist)
1495 {
1496 gint retval;
1497
1498 PLAYLIST_LOCK(playlist->mutex);
1499 retval = playlist_get_length_nolock(playlist);
1500 PLAYLIST_UNLOCK(playlist->mutex);
1501
1502 return retval;
1503 }
1504
1505 gint
1506 playlist_queue_get_length(Playlist *playlist)
1507 {
1508 gint length;
1509
1510 PLAYLIST_LOCK(playlist->mutex);
1511 length = g_list_length(playlist->queue);
1512 PLAYLIST_UNLOCK(playlist->mutex);
1513
1514 return length;
1515 }
1516
1517 gint
1518 playlist_get_length_nolock(Playlist *playlist)
1519 { 1507 {
1520 return g_list_length(playlist->entries); 1508 return g_list_length(playlist->entries);
1521 } 1509 }
1522 1510
1523 gchar * 1511 gchar *