[vlc-commits] playlist: cancel preparsing upon playback

Filip Roséen git at videolan.org
Wed Mar 29 17:37:09 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue Mar 21 02:02:38 2017 +0100| [cf59d2a336bda88b7837fe9309044818de462059] | committer: Hugo Beauzée-Luyssen

playlist: cancel preparsing upon playback

This will cancel any pending request for preparsing the relevant
playlist_item_t as preparsing the entity:

 - is redundant since we are about to start playback,
 - can remove metadata added during playback, and;
 - can lead to duplicate entries in the playlist if the
   playlist_item_t is a directory (as children are added each time
   such entity is "played").

fixes: #17441
fixes: #17232

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf59d2a336bda88b7837fe9309044818de462059
---

 src/playlist/item.c   | 2 +-
 src/playlist/thread.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index b166155..9d77a66 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -776,7 +776,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
     if( sys->b_preparse && !input_item_IsPreparsed( p_item->p_input )
      && (EMPTY_STR(psz_artist) || EMPTY_STR(psz_album)) )
         libvlc_MetadataRequest( p_playlist->obj.libvlc, p_item->p_input, 0, -1,
-                                NULL );
+                                p_item );
     free( psz_artist );
     free( psz_album );
 }
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 5e198a0..933244d 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -205,6 +205,8 @@ static bool PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
     assert( p_sys->p_input == NULL );
     PL_UNLOCK;
 
+    libvlc_MetadataCancel( p_playlist->obj.libvlc, p_item );
+
     input_thread_t *p_input_thread = input_Create( p_playlist, p_input, NULL,
                                                    p_sys->p_input_resource );
     if( likely(p_input_thread != NULL) )



More information about the vlc-commits mailing list