[vlc-devel] [PATCH 6/9] core: extend libvlc_MetaRequest and rename it
Thomas Guillem
thomas at gllm.fr
Sun Jun 5 11:41:47 CEST 2016
This function can now pass a timeout and an unique id that can be used to
cancel requests pushed with this id.
Rename it because Meta is too meta.
---
include/vlc_input_item.h | 5 +++--
lib/media.c | 2 +-
modules/gui/macosx/VLCPlaylist.m | 2 +-
modules/gui/macosx/VLCPlaylistInfo.m | 2 +-
src/input/input.c | 2 +-
src/libvlc.c | 7 ++++---
src/libvlccore.sym | 2 +-
7 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index f16491d..864b9fa 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -399,8 +399,9 @@ enum input_item_preparse_status
ITEM_PREPARSE_DONE
};
-VLC_API int libvlc_MetaRequest(libvlc_int_t *, input_item_t *,
- input_item_meta_request_option_t );
+VLC_API int libvlc_MetadataRequest( libvlc_int_t *, input_item_t *,
+ input_item_meta_request_option_t,
+ mtime_t, void * );
VLC_API int libvlc_ArtRequest(libvlc_int_t *, input_item_t *,
input_item_meta_request_option_t );
diff --git a/lib/media.c b/lib/media.c
index 1f7acae..6158b82 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -764,7 +764,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_MetaRequest(libvlc, item, parse_scope);
+ ret = libvlc_MetadataRequest(libvlc, item, parse_scope, -1, NULL);
if (ret != VLC_SUCCESS)
return ret;
}
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index e34f80f..9537e79 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -353,7 +353,7 @@
continue;
}
- libvlc_MetaRequest(p_intf->p_libvlc, [o_item input], META_REQUEST_OPTION_NONE);
+ libvlc_MetadataRequest(p_intf->p_libvlc, [o_item input], META_REQUEST_OPTION_NONE, -1, NULL);
}
[self playlistUpdated];
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index 1830769..871ca52 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -209,7 +209,7 @@
[_imageWell setImage: [NSImage imageNamed: @"noart.png"]];
} else {
if (!input_item_IsPreparsed(p_item))
- libvlc_MetaRequest(getIntf()->p_libvlc, p_item, META_REQUEST_OPTION_NONE);
+ libvlc_MetadataRequest(getIntf()->p_libvlc, p_item, META_REQUEST_OPTION_NONE, -1, NULL);
/* fill uri info */
char *psz_url = vlc_uri_decode(input_item_GetURI(p_item));
diff --git a/src/input/input.c b/src/input/input.c
index 5307203..7d2feb3 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -365,7 +365,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
else if( p_item->b_preparse_interact )
{
/* If true, this item was asked explicitly to interact with the user
- * (via libvlc_MetaRequest). Sub items created from this input won't
+ * (via libvlc_MetadataRequest). Sub items created from this input won't
* have this flag and won't interact with the user */
p_input->i_flags &= ~OBJECT_FLAGS_NOINTERACT;
}
diff --git a/src/libvlc.c b/src/libvlc.c
index 316f481..1897a57 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -613,8 +613,9 @@ 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.
*/
-int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item,
- input_item_meta_request_option_t i_options)
+int libvlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item,
+ input_item_meta_request_option_t i_options,
+ mtime_t timeout, void *id)
{
libvlc_priv_t *priv = libvlc_priv(libvlc);
@@ -627,7 +628,7 @@ int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item,
if( i_options & META_REQUEST_OPTION_DO_INTERACT )
item->b_preparse_interact = true;
vlc_mutex_unlock( &item->lock );
- playlist_preparser_Push(priv->parser, item, i_options, -1, NULL);
+ playlist_preparser_Push( priv->parser, item, i_options, timeout, id );
return VLC_SUCCESS;
}
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 2dcb5cf..6f25db1 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -238,7 +238,7 @@ libvlc_InternalDestroy
libvlc_InternalInit
libvlc_Quit
libvlc_SetExitHandler
-libvlc_MetaRequest
+libvlc_MetadataRequest
libvlc_ArtRequest
vlc_UrlParse
vlc_UrlClean
--
2.8.1
More information about the vlc-devel
mailing list