[vlc-devel] [PATCH 18/40] playlist: remove the skip flag

RĂ©mi Denis-Courmont remi at remlab.net
Sun May 14 17:45:48 CEST 2017


---
 include/vlc_playlist.h            |  1 -
 modules/lua/libs/playlist.c       |  1 -
 share/lua/README.txt              |  1 -
 src/playlist/services_discovery.c |  5 ++---
 src/playlist/thread.c             | 20 --------------------
 src/playlist/tree.c               |  2 +-
 6 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index ebd078404b..1e076c7b4d 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -136,7 +136,6 @@ struct playlist_item_t
 };
 
 typedef enum {
-    PLAYLIST_SKIP_FLAG         = 0x0002,  /**< Must playlist skip after it ? */
     PLAYLIST_DBL_FLAG          = 0x0004,  /**< Is it disabled ? */
     PLAYLIST_RO_FLAG           = 0x0008,  /**< Write-enabled ? */
     PLAYLIST_SUBITEM_STOP_FLAG = 0x0040,  /**< Must playlist stop if the item gets subitems ?*/
diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c
index f7770e8a38..be6643cd86 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -233,7 +233,6 @@ static void push_playlist_item( lua_State *L, playlist_item_t *p_item )
         lua_pushboolean( L, 1 ); \
         lua_setfield( L, -2, #label ); \
     }
-    CHECK_AND_SET_FLAG( SKIP, skip )
     CHECK_AND_SET_FLAG( DBL, disabled )
     CHECK_AND_SET_FLAG( RO, ro )
 #undef CHECK_AND_SET_FLAG
diff --git a/share/lua/README.txt b/share/lua/README.txt
index fd55bc3317..eb782ee030 100644
--- a/share/lua/README.txt
+++ b/share/lua/README.txt
@@ -285,7 +285,6 @@ playlist.get( [what, [tree]] ): Get the playlist.
       .id: The item's id.
       .flags: a table with the following members if the corresponding flag is
               set:
-          .skip
           .disabled
           .ro
       .name:
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 0435a9fc0c..0a5575f83e 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -55,8 +55,7 @@ static void playlist_sd_item_added(services_discovery_t *sd,
     playlist_Lock(playlist);
     if (sds->node == NULL)
         sds->node = playlist_NodeCreate(playlist, longname, &playlist->root,
-                                        PLAYLIST_END,
-                                        PLAYLIST_RO_FLAG|PLAYLIST_SKIP_FLAG);
+                                        PLAYLIST_END, PLAYLIST_RO_FLAG);
 
     if (parent != NULL)
         node = playlist_ItemGetByInput(playlist, parent);
@@ -138,7 +137,7 @@ int playlist_ServicesDiscoveryAdd(playlist_t *playlist, const char *chain)
     if (sds->node == NULL && sds->sd->description != NULL)
         sds->node = playlist_NodeCreate(playlist, sds->sd->description,
                                         &playlist->root, PLAYLIST_END,
-                                        PLAYLIST_RO_FLAG|PLAYLIST_SKIP_FLAG);
+                                        PLAYLIST_RO_FLAG);
 
     TAB_APPEND(pl_priv(playlist)->i_sds, pl_priv(playlist)->pp_sds, sds);
     playlist_Unlock(playlist);
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 933244de75..104c92364a 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -380,27 +380,10 @@ static playlist_item_t *NextItem( playlist_t *p_playlist )
         }
 
         /* */
-        if( get_current_status_item( p_playlist ) )
-        {
-            playlist_item_t *p_parent = get_current_status_item( p_playlist );
-            while( p_parent )
-            {
-                if( p_parent->i_flags & PLAYLIST_SKIP_FLAG )
-                {
-                    msg_Dbg( p_playlist, "blocking item, stopping") ;
-                    return NULL;
-                }
-                p_parent = p_parent->p_parent;
-            }
-        }
 
         PL_DEBUG( "changing item without a request (current %i/%i)",
                   p_playlist->i_current_index, p_playlist->current.i_size );
         /* Can't go to next from current item */
-        if( get_current_status_item( p_playlist ) &&
-            get_current_status_item( p_playlist )->i_flags & PLAYLIST_SKIP_FLAG )
-            return NULL;
-
         if( p_sys->b_reset_currently_playing )
             ResetCurrentlyPlaying( p_playlist,
                                    get_current_status_item( p_playlist ) );
@@ -424,9 +407,6 @@ static playlist_item_t *NextItem( playlist_t *p_playlist )
             return NULL;
 
         p_new = ARRAY_VAL( p_playlist->current, p_playlist->i_current_index );
-        /* The new item can't be autoselected  */
-        if( p_new != NULL && p_new->i_flags & PLAYLIST_SKIP_FLAG )
-            return NULL;
     }
     return p_new;
 }
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index 697e918d65..8ea9d9e44a 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -163,7 +163,7 @@ int playlist_NodeInsert( playlist_item_t *p_parent, playlist_item_t *p_item,
 
     /* Inherit special flags from parent (sd cases) */
     if( ( p_parent->i_flags & PLAYLIST_NO_INHERIT_FLAG ) == 0 )
-        p_item->i_flags |= (p_parent->i_flags & (PLAYLIST_RO_FLAG | PLAYLIST_SKIP_FLAG));
+        p_item->i_flags |= (p_parent->i_flags & PLAYLIST_RO_FLAG);
 
     return VLC_SUCCESS;
 }
-- 
2.11.0



More information about the vlc-devel mailing list