]> git.sesse.net Git - vlc/commitdiff
* src/playlist/*: portability fixes, moved playlist_AddOption() to item-ext.c.
authorGildas Bazin <gbazin@videolan.org>
Sat, 28 Feb 2004 17:10:23 +0000 (17:10 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 28 Feb 2004 17:10:23 +0000 (17:10 +0000)
src/playlist/info.c
src/playlist/item-ext.c
src/playlist/item.c

index 3ecb4aae843b3d9ff8801d97250cee72e7b36879..f0961102dcd2bdcbddc5a68ea762ec101ce4cd29 100644 (file)
@@ -2,7 +2,7 @@
  * info.c : Playlist info management
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: info.c,v 1.9 2004/02/08 18:17:22 gbazin Exp $
+ * $Id: info.c,v 1.10 2004/02/28 17:10:23 gbazin Exp $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *
@@ -325,39 +325,3 @@ int playlist_ItemAddInfo( playlist_item_t *p_item,
 
     return VLC_SUCCESS;
 }
-
-/**
- * Add a special info : option
- *
- * \param p_playlist the playlist
- * \param i_item the position of the item on which we
- *               add the option ( -1 for current )
- * \param psz_value the option to add
- * \return the info category.
- */
-int playlist_AddOption( playlist_t *p_playlist, int i_pos,
-                        const char *psz_option)
-{
-    playlist_item_t *p_item;
-
-    /* Check the existence of the playlist */
-    if( p_playlist == NULL)
-    {
-        return VLC_EGENERIC;
-    }
-
-    p_item = playlist_ItemGetByPos( p_playlist , i_pos );
-    if( !p_item )
-    {
-            return VLC_ENOOBJ;
-    }
-
-    vlc_mutex_lock( &p_item->lock );
-    INSERT_ELEM( p_item->ppsz_options,
-                 p_item->i_options,
-                 p_item->i_options,
-                 (char *)psz_option );
-    vlc_mutex_unlock( &p_item->lock );
-
-    return VLC_SUCCESS;
-}
index a6c4d3560bc7887c947008a70511f117f71af809..235b98262526de7fe25eb2e67f146f3cbf712800 100644 (file)
@@ -2,7 +2,7 @@
  * item-ext.c : Playlist item management functions
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: item-ext.c,v 1.13 2004/01/29 17:51:08 zorglub Exp $
+ * $Id: item-ext.c,v 1.14 2004/02/28 17:10:23 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Clément Stenac <zorglub@videolan.org>
@@ -446,8 +446,6 @@ int playlist_SetDuration( playlist_t *p_playlist, int i_pos, mtime_t i_duration
 int playlist_Delete( playlist_t * p_playlist, int i_pos )
 {
     vlc_value_t     val;
-    int i,j;
-    int i_delay=0;
 
     /* if i_pos is the current played item, playlist should stop playing it */
     if( ( p_playlist->i_status == PLAYLIST_RUNNING) &&
@@ -461,9 +459,11 @@ int playlist_Delete( playlist_t * p_playlist, int i_pos )
     {
         playlist_item_t *p_item = p_playlist->pp_items[i_pos];
 
-        msg_Dbg( p_playlist, "deleting playlist item « %s »",
+        msg_Dbg( p_playlist, "deleting playlist item `%s'",
                  p_item->psz_name );
 #if 0
+        int i,j;
+
         vlc_mutex_lock( &p_item->lock );
 
         if( p_item->psz_name )
@@ -577,7 +577,7 @@ int playlist_Disable( playlist_t * p_playlist, int i_pos )
 
     if( i_pos >= 0 && i_pos < p_playlist->i_size )
     {
-        msg_Dbg( p_playlist, "disabling playlist item « %s »",
+        msg_Dbg( p_playlist, "disabling playlist item `%s'",
                              p_playlist->pp_items[i_pos]->psz_name );
 
         if( p_playlist->pp_items[i_pos]->b_enabled == VLC_TRUE )
@@ -607,7 +607,7 @@ int playlist_Enable( playlist_t * p_playlist, int i_pos )
 
     if( i_pos >= 0 && i_pos < p_playlist->i_size )
     {
-        msg_Dbg( p_playlist, "enabling playlist item « %s »",
+        msg_Dbg( p_playlist, "enabling playlist item `%s'",
                              p_playlist->pp_items[i_pos]->psz_name );
 
         if( p_playlist->pp_items[i_pos]->b_enabled == VLC_FALSE )
@@ -642,7 +642,7 @@ int playlist_DisableGroup( playlist_t * p_playlist, int i_group)
     {
         if( p_playlist->pp_items[i]->i_group == i_group )
         {
-            msg_Dbg( p_playlist, "disabling playlist item « %s »",
+            msg_Dbg( p_playlist, "disabling playlist item `%s'",
                            p_playlist->pp_items[i]->psz_name );
 
             if( p_playlist->pp_items[i]->b_enabled == VLC_TRUE )
@@ -675,7 +675,7 @@ int playlist_EnableGroup( playlist_t * p_playlist, int i_group)
     {
         if( p_playlist->pp_items[i]->i_group == i_group )
         {
-            msg_Dbg( p_playlist, "enabling playlist item « %s »",
+            msg_Dbg( p_playlist, "enabling playlist item `%s'",
                            p_playlist->pp_items[i]->psz_name );
 
             if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE )
@@ -715,7 +715,7 @@ int playlist_Move( playlist_t * p_playlist, int i_pos, int i_newpos)
     {
         playlist_item_t * temp;
 
-        msg_Dbg( p_playlist, "moving playlist item « %s » (%i -> %i)",
+        msg_Dbg( p_playlist, "moving playlist item `%s' (%i -> %i)",
                              p_playlist->pp_items[i_pos]->psz_name, i_pos,
                              i_newpos );
 
@@ -761,3 +761,37 @@ int playlist_Move( playlist_t * p_playlist, int i_pos, int i_newpos)
 
     return VLC_SUCCESS;
 }
+
+/**
+ * Add a special info : option
+ *
+ * \param p_playlist the playlist
+ * \param i_item the position of the item on which we
+ *               add the option ( -1 for current )
+ * \param psz_value the option to add
+ * \return the info category.
+ */
+int playlist_AddOption( playlist_t *p_playlist, int i_pos,
+                        const char *psz_option )
+{
+    playlist_item_t *p_item;
+
+    /* Check the existence of the playlist */
+    if( p_playlist == NULL)
+    {
+        return VLC_EGENERIC;
+    }
+
+    p_item = playlist_ItemGetByPos( p_playlist , i_pos );
+    if( !p_item )
+    {
+            return VLC_ENOOBJ;
+    }
+
+    vlc_mutex_lock( &p_item->lock );
+    INSERT_ELEM( p_item->ppsz_options, p_item->i_options, p_item->i_options,
+                 strdup( psz_option ) );
+    vlc_mutex_unlock( &p_item->lock );
+
+    return VLC_SUCCESS;
+}
index 69b0b364974c9b35b50d3428a2e252816060edfa..b7ed84b25fd9c17f8aede183d6c35131aa9b9f64 100644 (file)
@@ -2,7 +2,7 @@
  * item.c : Playlist item functions
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: item.c,v 1.14 2004/02/08 18:17:22 gbazin Exp $
+ * $Id: item.c,v 1.15 2004/02/28 17:10:23 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -86,7 +86,8 @@ int playlist_AddItem( playlist_t *p_playlist, playlist_item_t * p_item,
     }
 
 
-    msg_Dbg( p_playlist, "adding playlist item « %s » ( %s )", p_item->psz_name, p_item->psz_uri);
+    msg_Dbg( p_playlist, "adding playlist item `%s' ( %s )",
+             p_item->psz_name, p_item->psz_uri );
 
 
     p_item->i_id = ++p_playlist->i_last_id;