Commit 4855a761 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Made mosaic shared struct per-instance rather than per-process

parent 8b7d91f2
......@@ -175,7 +175,7 @@ static int Open( vlc_object_t *p_this )
{
sout_stream_t *p_stream = (sout_stream_t *)p_this;
sout_stream_sys_t *p_sys;
vlc_object_t *p_libvlc_global = p_this->p_libvlc_global;
vlc_object_t *p_libvlc = p_this->p_libvlc;
vlc_value_t val;
config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options,
......@@ -190,8 +190,8 @@ static int Open( vlc_object_t *p_this )
p_stream->p_sys = p_sys;
p_sys->b_inited = VLC_FALSE;
var_Create( p_libvlc_global, "mosaic-lock", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "mosaic-lock", &val );
var_Create( p_libvlc, "mosaic-lock", VLC_VAR_MUTEX );
var_Get( p_libvlc, "mosaic-lock", &val );
p_sys->p_lock = val.p_address;
var_Get( p_stream, CFG_PREFIX "id", &val );
......@@ -316,14 +316,14 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
p_bridge = GetBridge( p_stream );
if ( p_bridge == NULL )
{
vlc_object_t *p_libvlc_global = p_stream->p_libvlc_global;
vlc_object_t *p_libvlc = p_stream->p_libvlc;
vlc_value_t val;
p_bridge = malloc( sizeof( bridge_t ) );
var_Create( p_libvlc_global, "mosaic-struct", VLC_VAR_ADDRESS );
var_Create( p_libvlc, "mosaic-struct", VLC_VAR_ADDRESS );
val.p_address = p_bridge;
var_Set( p_libvlc_global, "mosaic-struct", val );
var_Set( p_libvlc, "mosaic-struct", val );
p_bridge->i_es_num = 0;
p_bridge->pp_es = NULL;
......@@ -495,12 +495,12 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
if ( b_last_es )
{
vlc_object_t *p_libvlc_global = p_stream->p_libvlc_global;
vlc_object_t *p_libvlc = p_stream->p_libvlc;
for ( i = 0; i < p_bridge->i_es_num; i++ )
free( p_bridge->pp_es[i] );
free( p_bridge->pp_es );
free( p_bridge );
var_Destroy( p_libvlc_global, "mosaic-struct" );
var_Destroy( p_libvlc, "mosaic-struct" );
}
vlc_mutex_unlock( p_sys->p_lock );
......
......@@ -284,7 +284,7 @@ static int CreateFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys;
vlc_object_t *p_libvlc_global = p_filter->p_libvlc_global;
vlc_object_t *p_libvlc = p_filter->p_libvlc;
char *psz_order;
char *psz_offsets;
int i_index;
......@@ -306,8 +306,8 @@ static int CreateFilter( vlc_object_t *p_this )
vlc_mutex_init( p_filter, &p_sys->lock );
vlc_mutex_lock( &p_sys->lock );
var_Create( p_libvlc_global, "mosaic-lock", VLC_VAR_MUTEX );
var_Get( p_libvlc_global, "mosaic-lock", &val );
var_Create( p_libvlc, "mosaic-lock", VLC_VAR_MUTEX );
var_Get( p_libvlc, "mosaic-lock", &val );
p_sys->p_lock = val.p_address;
config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
......
......@@ -40,11 +40,11 @@ typedef struct bridge_t
#define GetBridge(a) __GetBridge( VLC_OBJECT(a) )
static bridge_t *__GetBridge( vlc_object_t *p_object )
{
vlc_object_t *p_libvlc_global = p_object->p_libvlc_global;
vlc_object_t *p_libvlc = p_object->p_libvlc;
bridge_t *p_bridge;
vlc_value_t val;
if( var_Get( p_libvlc_global, "mosaic-struct", &val ) != VLC_SUCCESS )
if( var_Get( p_libvlc, "mosaic-struct", &val ) != VLC_SUCCESS )
{
p_bridge = NULL;
}
......
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