[vlc-devel] [PATCH 07/11] playlist/thread: do not stop on removed node

Filip Roséen filip at atch.se
Thu May 18 12:01:14 CEST 2017

If get_current_status_item( p_playlist ) returns NULL there are no
previously "playing" entity on automatic next, meaning that it is very
confusing if the playlist stops at such (non-existing) entity.

Given a flat playlist, a node containing children will be removed and
the children posted to the node's parent, meaning that the original
node is removed. Given that the node is removed, stopping after
"playback" of such entity looks like we simply did nothing (imagine a
directory containing no children).
 src/playlist/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 104c92364a..5632babe4d 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -373,7 +373,7 @@ static playlist_item_t *NextItem( playlist_t *p_playlist )
             msg_Dbg( p_playlist,"repeating item" );
             return get_current_status_item( p_playlist );
-        if( b_playstop )
+        if( b_playstop && get_current_status_item( p_playlist ) )
             msg_Dbg( p_playlist,"stopping (play and stop)" );
             return NULL;

More information about the vlc-devel mailing list