X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcontrol%2Flibvlc_internal.h;h=bc545a598e94f6c57688274f38664f079058e035;hb=7db94f4d2fc742537828fbe0c8eb5a6612601749;hp=8ad972a787db2966dbcdb40df89eeca162efca8f;hpb=e996cbefaf0f8db55513071b9678242e0a7733da;p=vlc diff --git a/src/control/libvlc_internal.h b/src/control/libvlc_internal.h index 8ad972a787..bc545a598e 100644 --- a/src/control/libvlc_internal.h +++ b/src/control/libvlc_internal.h @@ -53,12 +53,6 @@ typedef void (*libvlc_vlm_release_func_t)( libvlc_instance_t * ) ; * Opaque structures for libvlc API ***************************************************************************/ -typedef enum libvlc_lock_state_t -{ - libvlc_Locked, - libvlc_UnLocked -} libvlc_lock_state_t; - typedef struct libvlc_vlm_t { vlm_t *p_vlm; @@ -70,11 +64,9 @@ struct libvlc_instance_t { libvlc_int_t *p_libvlc_int; libvlc_vlm_t libvlc_vlm; - int b_playlist_locked; unsigned ref_count; int verbosity; vlc_mutex_t instance_lock; - vlc_mutex_t event_callback_lock; struct libvlc_callback_entry_list_t *p_callback_list; }; @@ -112,9 +104,27 @@ void libvlc_event_attach_async( libvlc_event_manager_t * p_event_manager, /* Exception shorcuts */ -#define RAISENULL( ... ) { libvlc_exception_raise( p_e, __VA_ARGS__ ); \ +#define RAISENULL( ... ) { libvlc_printerr(__VA_ARGS__); \ + libvlc_exception_raise( p_e ); \ return NULL; } -#define RAISEZERO( ... ) { libvlc_exception_raise( p_e, __VA_ARGS__ ); \ +#define RAISEZERO( ... ) { libvlc_printerr(__VA_ARGS__); \ + libvlc_exception_raise( p_e ); \ return 0; } +static inline void clear_if_needed(libvlc_exception_t *e) +{ + if (libvlc_exception_raised(e)) + libvlc_exception_clear(e); +} + +static inline libvlc_time_t from_mtime(mtime_t time) +{ + return (time + 500ULL)/ 1000ULL; +} + +static inline mtime_t to_mtime(libvlc_time_t time) +{ + return time * 1000ULL; +} + #endif