diff src/audacious/playlist.c @ 4297:40a991213507

check if playlistwin_list is UiSkinnedPlaylist before accessing it contents
author Tomasz Mon <desowin@gmail.com>
date Fri, 22 Feb 2008 22:18:20 +0100
parents 3ff4aef1e401
children 6a87d1c1da32
line wrap: on
line diff
--- a/src/audacious/playlist.c	Fri Feb 22 18:08:35 2008 +0200
+++ b/src/audacious/playlist.c	Fri Feb 22 22:18:20 2008 +0100
@@ -77,7 +77,6 @@
 
 #include "playlist_evmessages.h"
 #include "playlist_evlisteners.h"
-#include "ui_skinned_playlist.h"
 
 typedef gint (*PlaylistCompareFunc) (PlaylistEntry * a, PlaylistEntry * b);
 typedef void (*PlaylistSaveFunc) (FILE * file);
@@ -1190,7 +1189,7 @@
         return;
 
     PLAYLIST_LOCK(playlist);
-    if (!playlist->position || !playlistwin_list) {
+    if (!playlist->position) {
         PLAYLIST_UNLOCK(playlist);
         return;
     }
@@ -1202,9 +1201,8 @@
         return;
     }
 
-    bottom = MAX(0, playlist_get_length(playlist) -
-                 UI_SKINNED_PLAYLIST(playlistwin_list)->num_visible);
-    row = CLAMP(pos - UI_SKINNED_PLAYLIST(playlistwin_list)->num_visible / 2, 0, bottom);
+    bottom = MAX(0, playlist_get_length(playlist) - playlistwin_list_get_visible_count());
+    row = CLAMP(pos - playlistwin_list_get_visible_count() / 2, 0, bottom);
     PLAYLIST_UNLOCK(playlist);
     playlistwin_set_toprow(row);
     g_cond_signal(cond_scan);