-#define vlm_New( a ) __vlm_New( VLC_OBJECT(a) )
-VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) );
-VLC_EXPORT( void, vlm_Delete, ( vlm_t * ) );
-VLC_EXPORT( int, vlm_ExecuteCommand, ( vlm_t *, const char *, vlm_message_t ** ) );
-VLC_EXPORT( void, vlm_MessageDelete, ( vlm_message_t * ) );
-VLC_EXPORT( vlm_media_t *, vlm_MediaNew, ( vlm_t *, const char *, int ) );
-VLC_EXPORT( void, vlm_MediaDelete, ( vlm_t *, vlm_media_t *, const char * ) );
-VLC_EXPORT( int, vlm_MediaSetup, ( vlm_t *, vlm_media_t *, const char *, const char * ) );
-VLC_EXPORT( int, vlm_MediaControl, ( vlm_t *, vlm_media_t *, const char *, const char *, const char * ) );
-VLC_EXPORT( vlm_media_t* , vlm_MediaSearch,( vlm_t *, const char *) );
-VLC_EXPORT( vlm_schedule_t *, vlm_ScheduleNew, ( vlm_t *, const char * ) );
-VLC_EXPORT( void, vlm_ScheduleDelete, ( vlm_t *, vlm_schedule_t *, const char * ) );
-VLC_EXPORT( int, vlm_ScheduleSetup, ( vlm_schedule_t *, const char *, const char * ) );
-VLC_EXPORT( int, vlm_MediaVodControl, ( void *, vod_media_t *, const char *, int, va_list ) );
-VLC_EXPORT( int, vlm_Save, ( vlm_t *, const char * ) );
-VLC_EXPORT( int, vlm_Load, ( vlm_t *, const char * ) );
+ p_dst->b_vod = p_src->b_vod;
+ if( p_src->b_vod )
+ {
+ if( p_src->vod.psz_mux )
+ p_dst->vod.psz_mux = strdup( p_src->vod.psz_mux );
+ }
+ else
+ {
+ p_dst->broadcast.b_loop = p_src->broadcast.b_loop;
+ }
+}
+static inline void vlm_media_Clean( vlm_media_t *p_media )
+{
+ int i;
+ free( p_media->psz_name );
+
+ for( i = 0; i < p_media->i_input; i++ )
+ free( p_media->ppsz_input[i]) ;
+ TAB_CLEAN(p_media->i_input, p_media->ppsz_input );
+
+ for( i = 0; i < p_media->i_option; i++ )
+ free( p_media->ppsz_option[i]) ;
+ TAB_CLEAN(p_media->i_option, p_media->ppsz_option );
+
+ free( p_media->psz_output );
+ if( p_media->b_vod )
+ free( p_media->vod.psz_mux );
+}
+static inline vlm_media_t *vlm_media_New(void)
+{
+ vlm_media_t *p_media = (vlm_media_t *)malloc( sizeof(vlm_media_t) );
+ if( p_media )
+ vlm_media_Init( p_media );
+ return p_media;
+}
+static inline void vlm_media_Delete( vlm_media_t *p_media )
+{
+ vlm_media_Clean( p_media );
+ free( p_media );
+}
+static inline vlm_media_t *vlm_media_Duplicate( vlm_media_t *p_src )
+{
+ vlm_media_t *p_dst = vlm_media_New();
+ if( p_dst )
+ vlm_media_Copy( p_dst, p_src );
+ return p_dst;
+}
+
+/* media instance helpers */
+static inline void vlm_media_instance_Init( vlm_media_instance_t *p_instance )
+{
+ memset( p_instance, 0, sizeof(vlm_media_instance_t) );
+ p_instance->psz_name = NULL;
+ p_instance->i_time = 0;
+ p_instance->i_length = 0;
+ p_instance->d_position = 0.0;
+ p_instance->b_paused = false;
+ p_instance->i_rate = INPUT_RATE_DEFAULT;
+}
+static inline void vlm_media_instance_Clean( vlm_media_instance_t *p_instance )
+{
+ free( p_instance->psz_name );
+}
+static inline vlm_media_instance_t *vlm_media_instance_New(void)
+{
+ vlm_media_instance_t *p_instance = (vlm_media_instance_t *) malloc( sizeof(vlm_media_instance_t) );
+ if( p_instance )
+ vlm_media_instance_Init( p_instance );
+ return p_instance;
+}
+static inline void vlm_media_instance_Delete( vlm_media_instance_t *p_instance )
+{
+ vlm_media_instance_Clean( p_instance );
+ free( p_instance );
+}
+
+#ifdef __cpluplus
+}
+#endif