Commit a0d1480b authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/skins/src/vlcproc.cpp: don't forget to lock the playlist object.

   Check p_playlist->i_index is != -1 as well.
parent 8b784013
...@@ -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.45 2003/10/15 12:24:14 gbazin Exp $ * $Id: vlcproc.cpp,v 1.46 2003/10/16 16:04:25 gbazin 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>
...@@ -279,6 +279,8 @@ void VlcProc::InterfaceRefresh() ...@@ -279,6 +279,8 @@ void VlcProc::InterfaceRefresh()
// Refresh // Refresh
if( PlayList != NULL ) if( PlayList != NULL )
{ {
vlc_mutex_lock( &PlayList->object_lock );
// Refresh stream control controls ! :) // Refresh stream control controls ! :)
switch( PlayList->i_status ) switch( PlayList->i_status )
{ {
...@@ -314,7 +316,7 @@ void VlcProc::InterfaceRefresh() ...@@ -314,7 +316,7 @@ void VlcProc::InterfaceRefresh()
EnabledEvent( "next", true ); EnabledEvent( "next", true );
// Update file name // Update file name
if( PlayList->i_index != Sys->i_index ) if( PlayList->i_index >= 0 && PlayList->i_index != Sys->i_index )
{ {
string long_name = PlayList->pp_items[PlayList->i_index]->psz_name; string long_name = PlayList->pp_items[PlayList->i_index]->psz_name;
int pos = long_name.rfind( DIRECTORY_SEPARATOR, long_name.size() ); int pos = long_name.rfind( DIRECTORY_SEPARATOR, long_name.size() );
...@@ -335,6 +337,8 @@ void VlcProc::InterfaceRefresh() ...@@ -335,6 +337,8 @@ void VlcProc::InterfaceRefresh()
Sys->i_size = PlayList->i_size; Sys->i_size = PlayList->i_size;
Sys->i_index = PlayList->i_index; Sys->i_index = PlayList->i_index;
} }
vlc_mutex_unlock( &PlayList->object_lock );
} }
else else
{ {
......
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