[vlc-devel] [PATCH 1/2] input/item: add input_item_AddOptions
Thomas Guillem
thomas at gllm.fr
Thu Apr 14 11:16:23 CEST 2016
---
include/vlc_input_item.h | 6 ++++++
src/input/item.c | 10 ++++++++++
src/libvlccore.sym | 1 +
3 files changed, 17 insertions(+)
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 14f569c..0e4ac73 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -203,6 +203,12 @@ enum input_item_option_e
* This function allows to add an option to an existing input_item_t.
*/
VLC_API int input_item_AddOption(input_item_t *, const char *, unsigned i_flags );
+/**
+ * This function add several options to an existing input_item_t.
+ */
+VLC_API int input_item_AddOptions(input_item_t *, int i_options,
+ const char *const *ppsz_options,
+ unsigned i_flags );
VLC_API int input_item_AddOpaque(input_item_t *, const char *, void *);
void input_item_ApplyOptions(vlc_object_t *, input_item_t *);
diff --git a/src/input/item.c b/src/input/item.c
index dc42eba..3d67a44 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -556,6 +556,16 @@ out:
return err;
}
+int input_item_AddOptions( input_item_t *p_item, int i_options,
+ const char *const *ppsz_options,
+ unsigned i_flags )
+{
+ int i_ret = VLC_SUCCESS;
+ for( int i = 0; i < i_options && i_ret == VLC_SUCCESS; i++ )
+ i_ret = input_item_AddOption( p_item, ppsz_options[i], i_flags );
+ return i_ret;
+}
+
int input_item_AddOpaque(input_item_t *item, const char *name, void *value)
{
assert(name != NULL);
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 0d69d14..8dff0c6 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -173,6 +173,7 @@ input_DecoderFlush
input_GetItem
input_item_AddInfo
input_item_AddOption
+input_item_AddOptions
input_item_AddOpaque
input_item_Copy
input_item_CopyOptions
--
2.8.0.rc3
More information about the vlc-devel
mailing list