Commit 2735cac2 authored by Cyril Deguet's avatar Cyril Deguet

* fixed refresh of the playlist (and a segfault...)

parent 53d2284d
......@@ -2,7 +2,7 @@
* playlist.cpp: Playlist control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.5 2003/04/20 15:00:19 karibu Exp $
* $Id: playlist.cpp,v 1.6 2003/04/21 00:18:37 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -215,11 +215,13 @@ bool ControlPlayList::ProcessEvent( Event *evt )
case PLAYLIST_ID_DEL:
if( (GenericControl *)evt->GetParam1() == this )
{
vlc_mutex_lock( &PlayList->object_lock );
for( int i = PlayList->i_size - 1; i >= 0; i-- )
{
if( Select[i] && i != PlayList->i_index )
playlist_Delete( PlayList, i );
}
vlc_mutex_unlock( &PlayList->object_lock );
RefreshAll();
}
break;
......@@ -229,6 +231,8 @@ bool ControlPlayList::ProcessEvent( Event *evt )
//---------------------------------------------------------------------------
void ControlPlayList::RefreshList()
{
vlc_mutex_lock( &PlayList->object_lock );
if( NumOfItems != PlayList->i_size )
{
if( NumOfItems > 0 )
......@@ -252,6 +256,8 @@ void ControlPlayList::RefreshList()
Slider->ChangeSliderRange( Range );
StartIndex = Slider->GetCursorPosition();
}
vlc_mutex_unlock( &PlayList->object_lock );
}
//---------------------------------------------------------------------------
void ControlPlayList::RefreshAll()
......@@ -290,7 +296,7 @@ void ControlPlayList::Draw( int x, int y, int w, int h, Graphics *dest )
void ControlPlayList::DrawAllCase( Graphics *dest, int x, int y, int w, int h )
{
int i;
for( i = 0; i < PlayList->i_size - StartIndex && i < Line * Column; i++ )
for( i = 0; i < NumOfItems - StartIndex && i < Line * Column; i++ )
{
DrawCase( dest, i + StartIndex, x, y, w, h );
}
......
......@@ -2,7 +2,7 @@
* gtk2_api.cpp: Various gtk2-specific functions
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_api.cpp,v 1.11 2003/04/16 21:40:07 ipkiss Exp $
* $Id: gtk2_api.cpp,v 1.12 2003/04/21 00:18:37 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -53,6 +53,7 @@ void OSAPI_PostMessage( Window *win, unsigned int message, unsigned int param1,
long param2 )
{
GdkEventClient *event = new GdkEventClient;
event->type = GDK_CLIENT_EVENT;
if( win == NULL )
event->window = NULL;
......
......@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.10 2003/04/20 20:28:39 ipkiss Exp $
* $Id: vlcproc.cpp,v 1.11 2003/04/21 00:18:37 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -232,10 +232,8 @@ void VlcProc::InterfaceRefresh( bool All )
Theme *Thema = Sys->p_theme;
playlist_t *PlayList = Sys->p_playlist;
// Refresh
if( PlayList != NULL && Sys->p_input != NULL &&
Sys->p_input->stream.b_seekable )
if( PlayList != NULL )
{
// Refresh stream control controls ! :)
switch( PlayList->i_status )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment