]> git.sesse.net Git - vlc/commitdiff
* src/playlist/item.c : stops the playlist if we delete the currently
authorSimon Latapie <garf@videolan.org>
Sun, 23 Nov 2003 16:24:20 +0000 (16:24 +0000)
committerSimon Latapie <garf@videolan.org>
Sun, 23 Nov 2003 16:24:20 +0000 (16:24 +0000)
   played item
 * doc/intf-http.txt : adding "pl.group"
 * share/http/index.html : little cosmetic change (better according to
   gibalou).

doc/intf-http.txt
modules/control/http.c
share/http/index.html
src/playlist/item.c

index 42eae3de862b3112cdd176a33b831ffaa20a830e..fadfe0af3ff2e96103c2c8034b386f9db2ae956b 100644 (file)
@@ -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.
index 7dfeded089991599eaf965ffc926554f324cc29d..d11e01169423b4c2a019204fd8767b3fedb5285c 100644 (file)
@@ -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;
                         }
                     }
index 07e8bd7380755a42c6a269c4bcf313aa72a5f200..b7ca4ccd35ddbed770719586b7fe7bfa4fab1ff5 100644 (file)
@@ -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>
          <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">
         </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>
index 5114221da5cf528654e9c05e48bb7a921fd05fb3..d696344502eb75b6d99297da5d98dfef8af1a403 100644 (file)
@@ -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 »",