[vlc-commits] libvlc: media: cancel preparsing when releasing a media

Thomas Guillem git at videolan.org
Sun Jun 5 13:02:14 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jun  1 11:33:40 2016 +0200| [6cf2720eb99f3706d02e5892d2e99fc52611122b] | committer: Thomas Guillem

libvlc: media: cancel preparsing when releasing a media

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

 lib/media.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/media.c b/lib/media.c
index 991a306..45ad99a 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -528,6 +528,10 @@ void libvlc_media_release( libvlc_media_t *p_md )
 
     uninstall_input_item_observer( p_md );
 
+    /* Cancel asynchronous parsing (if any) */
+    if( p_md->p_input_item )
+        libvlc_MetadataCancel( p_md->p_libvlc_instance->p_libvlc_int, p_md );
+
     if( p_md->p_subitems )
         libvlc_media_list_release( p_md->p_subitems );
 
@@ -764,7 +768,7 @@ static int media_parse(libvlc_media_t *media, bool b_async,
             parse_scope |= META_REQUEST_OPTION_SCOPE_NETWORK;
         if (parse_flag & libvlc_media_do_interact)
             parse_scope |= META_REQUEST_OPTION_DO_INTERACT;
-        ret = libvlc_MetadataRequest(libvlc, item, parse_scope, 0, NULL);
+        ret = libvlc_MetadataRequest(libvlc, item, parse_scope, 0, media);
         if (ret != VLC_SUCCESS)
             return ret;
     }



More information about the vlc-commits mailing list