vlc | branch: master | Thomas Guillem <[email protected]> | Wed Jun 1 11:29:12 2016 +0200| [dbf1a3b4443e2f6be27ee4e1516a6e3e8ff102c2] | committer: Thomas Guillem
core: add libvlc_MetadataCancel > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dbf1a3b4443e2f6be27ee4e1516a6e3e8ff102c2 --- include/vlc_input_item.h | 1 + src/libvlc.c | 19 ++++++++++++++++++- src/libvlccore.sym | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h index 50501bf..936afed 100644 --- a/include/vlc_input_item.h +++ b/include/vlc_input_item.h @@ -404,6 +404,7 @@ VLC_API int libvlc_MetadataRequest( libvlc_int_t *, input_item_t *, int, void * ); VLC_API int libvlc_ArtRequest(libvlc_int_t *, input_item_t *, input_item_meta_request_option_t ); +VLC_API void libvlc_MetadataCancel( libvlc_int_t *, void * ); /****************** * Input stats diff --git a/src/libvlc.c b/src/libvlc.c index 49e46ae..3ccdede 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -611,7 +611,8 @@ static void GetFilenames( libvlc_int_t *p_vlc, unsigned n, /** * Requests extraction of the meta data for an input item (a.k.a. preparsing). - * The actual extraction is asynchronous. + * The actual extraction is asynchronous. It can be cancelled with + * libvlc_MetadataCancel() */ int libvlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item, input_item_meta_request_option_t i_options, @@ -647,3 +648,19 @@ int libvlc_ArtRequest(libvlc_int_t *libvlc, input_item_t *item, playlist_preparser_fetcher_Push(priv->parser, item, i_options); return VLC_SUCCESS; } + +/** + * Cancels extraction of the meta data for an input item. + * + * This does nothing if the input item is already processed or if it was not + * added with libvlc_MetadataRequest() + */ +void libvlc_MetadataCancel(libvlc_int_t *libvlc, void *id) +{ + libvlc_priv_t *priv = libvlc_priv(libvlc); + + if (unlikely(priv->parser == NULL)) + return; + + playlist_preparser_Cancel(priv->parser, id); +} diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 6f25db1..6000b17 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -239,6 +239,7 @@ libvlc_InternalInit libvlc_Quit libvlc_SetExitHandler libvlc_MetadataRequest +libvlc_MetadataCancel libvlc_ArtRequest vlc_UrlParse vlc_UrlClean _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
