Commit 28d49d98 authored by Clément Stenac's avatar Clément Stenac

Store playlist object in instance-specific object

parent 8923568d
...@@ -5507,7 +5507,7 @@ dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for modu ...@@ -5507,7 +5507,7 @@ dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for modu
dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions]) dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
dnl New definitions with value matching 0.8.6 release dnl New definitions with value matching 0.8.6 release
module_symbol="0_8_6b" module_symbol="0_8_6c"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions]) AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions]) AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions])
VLC_ENTRY="vlc_entry__${module_symbol}" VLC_ENTRY="vlc_entry__${module_symbol}"
......
...@@ -80,28 +80,26 @@ struct libvlc_int_t ...@@ -80,28 +80,26 @@ struct libvlc_int_t
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
/* Global properties */ /* Global properties */
int i_argc; /* command line arguments count */ int i_argc; ///< command line arguments count
char ** ppsz_argv; /* command line arguments */ char ** ppsz_argv; ///< command line arguments
char * psz_homedir; /* configuration directory */ char * psz_homedir; ///< configuration directory
char * psz_userdir; /* user's home directory */ char * psz_userdir; ///< user's home directory
char * psz_configfile; /* location of config file */ char * psz_configfile; ///< location of config file
/* Fast memcpy plugin used */ playlist_t *p_playlist; ///< playlist object
module_t * p_memcpy_module;
void* ( *pf_memcpy ) ( void *, const void *, size_t ); module_t * p_memcpy_module; ///< Fast memcpy plugin used
void* ( *pf_memset ) ( void *, int, size_t ); void* ( *pf_memcpy ) ( void *, const void *, size_t ); ///< fast memcpy
void* ( *pf_memset ) ( void *, int, size_t ); ///< fast memset
/* Statistics */
vlc_bool_t b_stats; ///< Should we collect stats vlc_bool_t b_stats; ///< Should we collect stats ?
/* Timers handling */
vlc_mutex_t timer_lock; ///< Lock to protect timers vlc_mutex_t timer_lock; ///< Lock to protect timers
int i_timers; ///< Number of timers int i_timers; ///< Number of timers
counter_t **pp_timers; ///< Array of all timers counter_t **pp_timers; ///< Array of all timers
/* Locks */ vlc_mutex_t config_lock; ///< Lock for the config file
vlc_mutex_t config_lock; /* lock for the config file */
#ifdef __APPLE__ #ifdef __APPLE__
vlc_mutex_t quicktime_lock; /* QT is not thread safe on OSX */ vlc_mutex_t quicktime_lock; ///< QT is not thread safe on OSX
#endif #endif
/* Structure storing the action name / key associations */ /* Structure storing the action name / key associations */
......
...@@ -201,7 +201,7 @@ struct playlist_add_t ...@@ -201,7 +201,7 @@ struct playlist_add_t
/* Global thread */ /* Global thread */
#define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a)) #define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a))
playlist_t *__playlist_ThreadCreate ( vlc_object_t * ); void __playlist_ThreadCreate ( vlc_object_t * );
int playlist_ThreadDestroy ( playlist_t * ); int playlist_ThreadDestroy ( playlist_t * );
/* Helpers */ /* Helpers */
......
This diff is collapsed.
...@@ -53,6 +53,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent ) ...@@ -53,6 +53,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
msg_Err( p_parent, "out of memory" ); msg_Err( p_parent, "out of memory" );
return NULL; return NULL;
} }
p_parent->p_libvlc->p_playlist = p_playlist;
VariablesInit( p_playlist ); VariablesInit( p_playlist );
...@@ -170,6 +171,7 @@ void playlist_Destroy( playlist_t *p_playlist ) ...@@ -170,6 +171,7 @@ void playlist_Destroy( playlist_t *p_playlist )
vlc_mutex_destroy( &p_playlist->gc_lock ); vlc_mutex_destroy( &p_playlist->gc_lock );
vlc_object_destroy( p_playlist->p_preparse ); vlc_object_destroy( p_playlist->p_preparse );
vlc_object_detach( p_playlist );
vlc_object_destroy( p_playlist ); vlc_object_destroy( p_playlist );
} }
......
...@@ -56,9 +56,9 @@ playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj, ...@@ -56,9 +56,9 @@ playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj,
playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj, playlist_item_t *__playlist_ItemNewFromInput( vlc_object_t *p_obj,
input_item_t *p_input ) input_item_t *p_input )
{ {
/** FIXME !!!!! don't find playlist each time */
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_obj, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
DECMALLOC_NULL( p_item, playlist_item_t ); DECMALLOC_NULL( p_item, playlist_item_t );
playlist_t *p_playlist = p_obj->p_libvlc->p_playlist;
vlc_object_yield( p_playlist );
p_item->p_input = p_input; p_item->p_input = p_input;
vlc_gc_incref( p_item->p_input ); vlc_gc_incref( p_item->p_input );
......
...@@ -57,12 +57,12 @@ static void DestroyInteraction( playlist_t * ); ...@@ -57,12 +57,12 @@ static void DestroyInteraction( playlist_t * );
* \param p_parent * \param p_parent
* \return an object with a started thread * \return an object with a started thread
*/ */
playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent ) void __playlist_ThreadCreate( vlc_object_t *p_parent )
{ {
playlist_t *p_playlist; playlist_t *p_playlist;
p_playlist = CreatePlaylist( p_parent ); p_playlist = CreatePlaylist( p_parent );
if( !p_playlist ) return NULL; if( !p_playlist ) return;
// Stats // Stats
p_playlist->p_stats = (global_stats_t *)malloc( sizeof( global_stats_t ) ); p_playlist->p_stats = (global_stats_t *)malloc( sizeof( global_stats_t ) );
...@@ -78,7 +78,7 @@ playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent ) ...@@ -78,7 +78,7 @@ playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent )
{ {
msg_Err( p_playlist, "unable to create preparser" ); msg_Err( p_playlist, "unable to create preparser" );
vlc_object_destroy( p_playlist ); vlc_object_destroy( p_playlist );
return NULL; return;
} }
p_playlist->p_preparse->i_waiting = 0; p_playlist->p_preparse->i_waiting = 0;
p_playlist->p_preparse->pp_waiting = NULL; p_playlist->p_preparse->pp_waiting = NULL;
...@@ -90,7 +90,7 @@ playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent ) ...@@ -90,7 +90,7 @@ playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent )
msg_Err( p_playlist, "cannot spawn preparse thread" ); msg_Err( p_playlist, "cannot spawn preparse thread" );
vlc_object_detach( p_playlist->p_preparse ); vlc_object_detach( p_playlist->p_preparse );
vlc_object_destroy( p_playlist->p_preparse ); vlc_object_destroy( p_playlist->p_preparse );
return NULL; return;
} }
// Start the thread // Start the thread
...@@ -99,13 +99,13 @@ playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent ) ...@@ -99,13 +99,13 @@ playlist_t * __playlist_ThreadCreate( vlc_object_t *p_parent )
{ {
msg_Err( p_playlist, "cannot spawn playlist thread" ); msg_Err( p_playlist, "cannot spawn playlist thread" );
vlc_object_destroy( p_playlist ); vlc_object_destroy( p_playlist );
return NULL; return;
} }
/* The object has been initialized, now attach it */ /* The object has been initialized, now attach it */
vlc_object_attach( p_playlist, p_parent ); vlc_object_attach( p_playlist, p_parent );
return p_playlist; return;
} }
/** /**
......
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