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

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

parent 53d2284d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp: Playlist control * playlist.cpp: Playlist control
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -215,11 +215,13 @@ bool ControlPlayList::ProcessEvent( Event *evt ) ...@@ -215,11 +215,13 @@ bool ControlPlayList::ProcessEvent( Event *evt )
case PLAYLIST_ID_DEL: case PLAYLIST_ID_DEL:
if( (GenericControl *)evt->GetParam1() == this ) if( (GenericControl *)evt->GetParam1() == this )
{ {
vlc_mutex_lock( &PlayList->object_lock );
for( int i = PlayList->i_size - 1; i >= 0; i-- ) for( int i = PlayList->i_size - 1; i >= 0; i-- )
{ {
if( Select[i] && i != PlayList->i_index ) if( Select[i] && i != PlayList->i_index )
playlist_Delete( PlayList, i ); playlist_Delete( PlayList, i );
} }
vlc_mutex_unlock( &PlayList->object_lock );
RefreshAll(); RefreshAll();
} }
break; break;
...@@ -229,6 +231,8 @@ bool ControlPlayList::ProcessEvent( Event *evt ) ...@@ -229,6 +231,8 @@ bool ControlPlayList::ProcessEvent( Event *evt )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void ControlPlayList::RefreshList() void ControlPlayList::RefreshList()
{ {
vlc_mutex_lock( &PlayList->object_lock );
if( NumOfItems != PlayList->i_size ) if( NumOfItems != PlayList->i_size )
{ {
if( NumOfItems > 0 ) if( NumOfItems > 0 )
...@@ -252,6 +256,8 @@ void ControlPlayList::RefreshList() ...@@ -252,6 +256,8 @@ void ControlPlayList::RefreshList()
Slider->ChangeSliderRange( Range ); Slider->ChangeSliderRange( Range );
StartIndex = Slider->GetCursorPosition(); StartIndex = Slider->GetCursorPosition();
} }
vlc_mutex_unlock( &PlayList->object_lock );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void ControlPlayList::RefreshAll() void ControlPlayList::RefreshAll()
...@@ -290,7 +296,7 @@ void ControlPlayList::Draw( int x, int y, int w, int h, Graphics *dest ) ...@@ -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 ) void ControlPlayList::DrawAllCase( Graphics *dest, int x, int y, int w, int h )
{ {
int i; 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 ); DrawCase( dest, i + StartIndex, x, y, w, h );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_api.cpp: Various gtk2-specific functions * gtk2_api.cpp: Various gtk2-specific functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -53,6 +53,7 @@ void OSAPI_PostMessage( Window *win, unsigned int message, unsigned int param1, ...@@ -53,6 +53,7 @@ void OSAPI_PostMessage( Window *win, unsigned int message, unsigned int param1,
long param2 ) long param2 )
{ {
GdkEventClient *event = new GdkEventClient; GdkEventClient *event = new GdkEventClient;
event->type = GDK_CLIENT_EVENT; event->type = GDK_CLIENT_EVENT;
if( win == NULL ) if( win == NULL )
event->window = NULL; event->window = NULL;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class * vlcproc.cpp: VlcProc class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -232,10 +232,8 @@ void VlcProc::InterfaceRefresh( bool All ) ...@@ -232,10 +232,8 @@ void VlcProc::InterfaceRefresh( bool All )
Theme *Thema = Sys->p_theme; Theme *Thema = Sys->p_theme;
playlist_t *PlayList = Sys->p_playlist; playlist_t *PlayList = Sys->p_playlist;
// Refresh // Refresh
if( PlayList != NULL && Sys->p_input != NULL && if( PlayList != NULL )
Sys->p_input->stream.b_seekable )
{ {
// Refresh stream control controls ! :) // Refresh stream control controls ! :)
switch( PlayList->i_status ) 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