From 32ed571bf3bd17fc99c8d2c3c4234a72de069946 Mon Sep 17 00:00:00 2001 From: Simon Latapie <garf@videolan.org> Date: Sun, 23 Nov 2003 16:24:20 +0000 Subject: [PATCH] * src/playlist/item.c : stops the playlist if we delete the currently played item * doc/intf-http.txt : adding "pl.group" * share/http/index.html : little cosmetic change (better according to gibalou). --- doc/intf-http.txt | 1 + modules/control/http.c | 26 ++++++-------------------- share/http/index.html | 16 +++++++--------- src/playlist/item.c | 8 +++++++- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/doc/intf-http.txt b/doc/intf-http.txt index 42eae3de862b..fadfe0af3ff2 100644 --- a/doc/intf-http.txt +++ b/doc/intf-http.txt @@ -323,6 +323,7 @@ variable will be displayed (instead of it name). - index : the index value (to be used for example for the "delete" control command. - name + - group : the group number - "informations" : Create informations for the current playing stream. diff --git a/modules/control/http.c b/modules/control/http.c index 7dfeded08999..d11e01169423 100644 --- a/modules/control/http.c +++ b/modules/control/http.c @@ -2,7 +2,7 @@ * http.c : http mini-server ;) ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: http.c,v 1.37 2003/11/20 08:44:30 garf Exp $ + * $Id: http.c,v 1.38 2003/11/23 16:24:20 garf Exp $ * * Authors: Gildas Bazin <gbazin@netcourrier.com> * Laurent Aimar <fenrir@via.ecp.fr> @@ -1768,9 +1768,8 @@ static void MacroDo( httpd_file_callback_args_t *p_args, } case MVLC_DEL: { - int i_item, *p_items = NULL, i_nb_items = 0, i_current = -1; + int i_item, *p_items = NULL, i_nb_items = 0; char item[512], *p_parser = p_request; - vlc_value_t val; /* Get the list of items to delete */ while( (p_parser = @@ -1785,16 +1784,6 @@ static void MacroDo( httpd_file_callback_args_t *p_args, i_nb_items++; } - /* we should not remove an item while it is played by VLC */ - var_Get( p_sys->p_input, "state", &val ); - if( val.i_int == PLAYING_S ) - { - i_current = p_sys->p_playlist->i_index; - } else - { - i_current = -1; - } - /* The items need to be deleted from in reversed order */ if( i_nb_items ) { @@ -1808,13 +1797,10 @@ static void MacroDo( httpd_file_callback_args_t *p_args, i_index = j; } - if( p_items[i_index] != i_current ) - { - playlist_Delete( p_sys->p_playlist, - p_items[i_index] ); - msg_Dbg( p_intf, "requested playlist delete: %d", - p_items[i_index] ); - } + playlist_Delete( p_sys->p_playlist, + p_items[i_index] ); + msg_Dbg( p_intf, "requested playlist delete: %d", + p_items[i_index] ); p_items[i_index] = -1; } } diff --git a/share/http/index.html b/share/http/index.html index 07e8bd738075..b7ca4ccd35dd 100644 --- a/share/http/index.html +++ b/share/http/index.html @@ -6,10 +6,6 @@ <title>VLC Media Player</title> <link href="/style.css" title="Default" rel="stylesheet" /> - <vlc id="if" param1="url_param"/> - <meta http-equiv="refresh" content="0;URL=/" /> - <vlc id="end" /> - <vlc id="control" param1="stop,pause,previous,next,add,sout,play,delete,empty,seek,fullscreen,keep,volume,sort" /> <vlc id="set" param1="sout" param2="string" /> </head> @@ -33,11 +29,6 @@ <input type="submit" name="control" value="fullscreen" /> </td> </form> - <form> - <td align="right" nowrap="1"> - Current Volume: <vlc id="value" param1="volume" /> <input type="text" name="value" size="5"><input type="hidden" name="control" value="volume"><input type="submit" name="Set" value="Set"> - </td> - </form> </tr> <tr> <td colspan="2"> @@ -59,6 +50,13 @@ </table> </td> </tr> + <tr> + <form> + <td> + Current Volume: <vlc id="value" param1="volume" /> <input type="text" name="value" size="5"><input type="hidden" name="control" value="volume"><input type="submit" name="Set" value="Set"> + </td> + </form> + </tr> </table> </div> <div class="sectitle">Add</div> diff --git a/src/playlist/item.c b/src/playlist/item.c index 5114221da5cf..d696344502eb 100644 --- a/src/playlist/item.c +++ b/src/playlist/item.c @@ -2,7 +2,7 @@ * item.c : Playlist item functions ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: item.c,v 1.2 2003/11/22 12:35:17 sigmunau Exp $ + * $Id: item.c,v 1.3 2003/11/23 16:24:20 garf Exp $ * * Authors: Samuel Hocevar <sam@zoy.org> * @@ -255,6 +255,12 @@ int playlist_Delete( playlist_t * p_playlist, int i_pos ) vlc_value_t val; vlc_mutex_lock( &p_playlist->object_lock ); + /* if i_pos is the current played item, playlist should stop playing it */ + if( ( p_playlist->i_status == PLAYLIST_RUNNING) && (p_playlist->i_index == i_pos) ) + { + playlist_Command( p_playlist, PLAYLIST_STOP, 0 ); + } + if( i_pos >= 0 && i_pos < p_playlist->i_size ) { msg_Dbg( p_playlist, "deleting playlist item « %s »", -- GitLab