Commit d8c509a8 authored by Clément Stenac's avatar Clément Stenac

Fix deadlocks in playlist

parent 87eb9dcd
...@@ -57,6 +57,8 @@ vlc_module_begin(); ...@@ -57,6 +57,8 @@ vlc_module_begin();
add_shortcut( "dts" ); add_shortcut( "dts" );
add_shortcut( "mod" ); add_shortcut( "mod" );
add_shortcut( "flac" ); add_shortcut( "flac" );
add_shortcut( "m3u" );
add_shortcut( "playlist" );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* item.c : Playlist item functions * item.c : Playlist item functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 VideoLAN * Copyright (C) 1999-2004 VideoLAN
* $Id: item.c,v 1.15 2004/02/28 17:10:23 gbazin Exp $ * $Id$
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* loadsave.c : Playlist loading / saving functions * loadsave.c : Playlist loading / saving functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 VideoLAN * Copyright (C) 1999-2004 VideoLAN
* $Id: loadsave.c,v 1.11 2004/03/03 20:39:53 gbazin Exp $ * $Id$
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -60,15 +60,16 @@ int playlist_Import( playlist_t * p_playlist, const char *psz_filename ) ...@@ -60,15 +60,16 @@ int playlist_Import( playlist_t * p_playlist, const char *psz_filename )
psz_uri = (char *)malloc(sizeof(char)*strlen(psz_filename) + 17 ); psz_uri = (char *)malloc(sizeof(char)*strlen(psz_filename) + 17 );
sprintf( psz_uri, "file/playlist://%s", psz_filename); sprintf( psz_uri, "file/playlist://%s", psz_filename);
vlc_mutex_lock( &p_playlist->object_lock );
i_id = playlist_Add( p_playlist, psz_uri, psz_uri, i_id = playlist_Add( p_playlist, psz_uri, psz_uri,
PLAYLIST_INSERT | PLAYLIST_GO , PLAYLIST_END); PLAYLIST_INSERT , PLAYLIST_END);
vlc_mutex_lock( &p_playlist->object_lock );
p_item = playlist_ItemGetById( p_playlist, i_id ); p_item = playlist_ItemGetById( p_playlist, i_id );
p_item->b_autodeletion = VLC_TRUE; p_item->b_autodeletion = VLC_TRUE;
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play(p_playlist);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -580,11 +580,13 @@ static void PlayItem( playlist_t *p_playlist ) ...@@ -580,11 +580,13 @@ static void PlayItem( playlist_t *p_playlist )
p_item = p_playlist->pp_items[p_playlist->i_index]; p_item = p_playlist->pp_items[p_playlist->i_index];
p_item->i_nb_played++; p_item->i_nb_played++;
p_playlist->p_input = input_CreateThread( p_playlist, p_item->psz_uri, p_playlist->p_input = input_CreateThread( p_playlist, p_item->psz_uri,
p_item->ppsz_options, p_item->ppsz_options,
p_item->i_options ); p_item->i_options );
val.i_int = p_playlist->i_index; val.i_int = p_playlist->i_index;
/* unlock the playlist to set the var...mmm */
vlc_mutex_unlock( &p_playlist->object_lock);
var_Set( p_playlist, "playlist-current", val); var_Set( p_playlist, "playlist-current", val);
vlc_mutex_lock( &p_playlist->object_lock);
} }
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