Commit 2d81d799 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Do not use an enumeration for a bits field

This violates the C standard. Passing a value outside not part of the
enumeration is undefined. This obviously excludes bits fields.
parent 8c7eaa23
...@@ -97,11 +97,11 @@ typedef enum libvlc_state_t ...@@ -97,11 +97,11 @@ typedef enum libvlc_state_t
libvlc_Error libvlc_Error
} libvlc_state_t; } libvlc_state_t;
typedef enum libvlc_media_option_t enum
{ {
libvlc_media_option_trusted = 0x2, libvlc_media_option_trusted = 0x2,
libvlc_media_option_unique = 0x100 libvlc_media_option_unique = 0x100
} libvlc_media_option_t; };
typedef enum libvlc_es_type_t typedef enum libvlc_es_type_t
{ {
...@@ -223,7 +223,7 @@ VLC_PUBLIC_API void libvlc_media_add_option( ...@@ -223,7 +223,7 @@ VLC_PUBLIC_API void libvlc_media_add_option(
VLC_PUBLIC_API void libvlc_media_add_option_flag( VLC_PUBLIC_API void libvlc_media_add_option_flag(
libvlc_media_t * p_md, libvlc_media_t * p_md,
const char * ppsz_options, const char * ppsz_options,
libvlc_media_option_t i_flags ); unsigned i_flags );
/** /**
......
...@@ -348,24 +348,21 @@ libvlc_media_t * libvlc_media_new_as_node( libvlc_instance_t *p_instance, ...@@ -348,24 +348,21 @@ libvlc_media_t * libvlc_media_new_as_node( libvlc_instance_t *p_instance,
* *
* The options are detailled in vlc --long-help, for instance "--sout-all" * The options are detailled in vlc --long-help, for instance "--sout-all"
**************************************************************************/ **************************************************************************/
void libvlc_media_add_option( void libvlc_media_add_option( libvlc_media_t * p_md,
libvlc_media_t * p_md, const char * psz_option )
const char * psz_option )
{ {
input_item_AddOption( p_md->p_input_item, psz_option, libvlc_media_add_option_flag( p_md, psz_option,
VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED ); VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED );
} }
/************************************************************************** /**************************************************************************
* Same as libvlc_media_add_option but with configurable flags. * Same as libvlc_media_add_option but with configurable flags.
**************************************************************************/ **************************************************************************/
void libvlc_media_add_option_flag( void libvlc_media_add_option_flag( libvlc_media_t * p_md,
libvlc_media_t * p_md,
const char * ppsz_option, const char * ppsz_option,
libvlc_media_option_t i_flags ) unsigned i_flags )
{ {
input_item_AddOption( p_md->p_input_item, ppsz_option, input_item_AddOption( p_md->p_input_item, ppsz_option, i_flags );
i_flags );
} }
/************************************************************************** /**************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment