Commit 35b69681 authored by Gildas Bazin's avatar Gildas Bazin

* include/vlc_playlist.h, src/playlist/playlist.c: added a b_autodeletion
   flag to the playlist item structure. If this flag is set then the playlist
   item will be deleted automatically after it has been played.
parent 90fe4445
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions * vlc_playlist.h : Playlist functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.4 2002/07/31 20:56:50 sam Exp $ * $Id: vlc_playlist.h,v 1.5 2002/11/12 21:20:36 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -29,6 +29,7 @@ struct playlist_item_t ...@@ -29,6 +29,7 @@ struct playlist_item_t
char * psz_name; char * psz_name;
int i_type; /* unused yet */ int i_type; /* unused yet */
int i_status; /* unused yet */ int i_status; /* unused yet */
vlc_bool_t b_autodeletion;
}; };
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.17 2002/11/10 18:04:24 sam Exp $ * $Id: playlist.c,v 1.18 2002/11/12 21:20:36 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -117,6 +117,7 @@ int playlist_Add( playlist_t *p_playlist, const char * psz_target, ...@@ -117,6 +117,7 @@ int playlist_Add( playlist_t *p_playlist, const char * psz_target,
p_item->psz_name = strdup( psz_target ); p_item->psz_name = strdup( psz_target );
p_item->i_type = 0; p_item->i_type = 0;
p_item->i_status = 0; p_item->i_status = 0;
p_item->b_autodeletion = VLC_FALSE;
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
...@@ -304,6 +305,10 @@ static void RunThread ( playlist_t *p_playlist ) ...@@ -304,6 +305,10 @@ static void RunThread ( playlist_t *p_playlist )
* in input_DestroyThread() for some time. */ * in input_DestroyThread() for some time. */
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
/* Check for autodeletion */
if( p_playlist->pp_items[p_playlist->i_index]->b_autodeletion )
playlist_Delete( p_playlist, p_playlist->i_index );
/* Destroy input */ /* Destroy input */
input_DestroyThread( p_input ); input_DestroyThread( p_input );
vlc_object_destroy( p_input ); vlc_object_destroy( p_input );
......
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