Commit 67c571cf authored by Mark Moriarty's avatar Mark Moriarty

Change marquee callback variables to use INPUT instead of PLAYLIST

parent c6d7c7f5
...@@ -860,6 +860,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -860,6 +860,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
intf_thread_t *p_intf = (intf_thread_t*)p_this; intf_thread_t *p_intf = (intf_thread_t*)p_this;
vlc_object_t *p_pl; vlc_object_t *p_pl;
vlc_value_t val; vlc_value_t val;
vlc_object_t *p_inp;
p_pl = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, p_pl = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
...@@ -867,6 +868,13 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -867,6 +868,13 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
{ {
return VLC_ENOOBJ; return VLC_ENOOBJ;
} }
p_inp = vlc_object_find( p_this, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( !p_inp )
{
return VLC_ENOOBJ;
}
/* Parse miscellaneous commands */ /* Parse miscellaneous commands */
if( !strcmp( psz_cmd, "marq-marquee" ) ) if( !strcmp( psz_cmd, "marq-marquee" ) )
...@@ -874,12 +882,12 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -874,12 +882,12 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0 ) if( strlen( newval.psz_string ) > 0 )
{ {
val.psz_string = newval.psz_string; val.psz_string = newval.psz_string;
var_Set( p_pl, "marq-marquee", val ); var_Set( p_inp, "marq-marquee", val );
} }
else else
{ {
val.psz_string = ""; val.psz_string = "";
var_Set( p_pl, "marq-marquee", val); var_Set( p_inp, "marq-marquee", val);
} }
} }
else if( !strcmp( psz_cmd, "marq-x" ) ) else if( !strcmp( psz_cmd, "marq-x" ) )
...@@ -887,7 +895,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -887,7 +895,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0) if( strlen( newval.psz_string ) > 0)
{ {
val.i_int = atoi( newval.psz_string ); val.i_int = atoi( newval.psz_string );
var_Set( p_pl, "marq-x", val ); var_Set( p_inp, "marq-x", val );
} }
} }
else if( !strcmp( psz_cmd, "marq-y" ) ) else if( !strcmp( psz_cmd, "marq-y" ) )
...@@ -895,7 +903,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -895,7 +903,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0) if( strlen( newval.psz_string ) > 0)
{ {
val.i_int = atoi( newval.psz_string ); val.i_int = atoi( newval.psz_string );
var_Set( p_pl, "marq-y", val ); var_Set( p_inp, "marq-y", val );
} }
} }
else if( !strcmp( psz_cmd, "marq-timeout" ) ) else if( !strcmp( psz_cmd, "marq-timeout" ) )
...@@ -903,7 +911,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -903,7 +911,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
if( strlen( newval.psz_string ) > 0) if( strlen( newval.psz_string ) > 0)
{ {
val.i_int = atoi( newval.psz_string ); val.i_int = atoi( newval.psz_string );
var_Set( p_pl, "marq-timeout", val ); var_Set( p_inp, "marq-timeout", val );
} }
} }
...@@ -916,6 +924,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -916,6 +924,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
} }
vlc_object_release( p_pl ); vlc_object_release( p_pl );
vlc_object_release( p_inp );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -94,7 +94,7 @@ static int CreateFilter( vlc_object_t *p_this ) ...@@ -94,7 +94,7 @@ static int CreateFilter( vlc_object_t *p_this )
{ {
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys; filter_sys_t *p_sys;
vlc_object_t *p_pl; vlc_object_t *p_input;
/* Allocate structure */ /* Allocate structure */
p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) ); p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
...@@ -105,24 +105,24 @@ static int CreateFilter( vlc_object_t *p_this ) ...@@ -105,24 +105,24 @@ static int CreateFilter( vlc_object_t *p_this )
} }
/* hook to the playlist */ /* hook to the playlist */
p_pl = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_ANYWHERE );
if( !p_pl ) if( !p_input )
{ {
return VLC_ENOOBJ; return VLC_ENOOBJ;
} }
/* p_access->p_libvlc p_demux->p_libvlc */ /* p_access->p_libvlc p_demux->p_libvlc */
p_sys->i_xoff = var_CreateGetInteger( p_pl , "marq-x" ); p_sys->i_xoff = var_CreateGetInteger( p_input , "marq-x" );
p_sys->i_yoff = var_CreateGetInteger( p_pl , "marq-y" ); p_sys->i_yoff = var_CreateGetInteger( p_input , "marq-y" );
p_sys->i_timeout = var_CreateGetInteger( p_pl , "marq-timeout" ); p_sys->i_timeout = var_CreateGetInteger( p_input , "marq-timeout" );
p_sys->psz_marquee = var_CreateGetString( p_pl, "marq-marquee" ); p_sys->psz_marquee = var_CreateGetString( p_input, "marq-marquee" );
var_AddCallback( p_pl, "marq-x", MarqueeCallback, p_sys ); var_AddCallback( p_input, "marq-x", MarqueeCallback, p_sys );
var_AddCallback( p_pl, "marq-y", MarqueeCallback, p_sys ); var_AddCallback( p_input, "marq-y", MarqueeCallback, p_sys );
var_AddCallback( p_pl, "marq-marquee", MarqueeCallback, p_sys ); var_AddCallback( p_input, "marq-marquee", MarqueeCallback, p_sys );
var_AddCallback( p_pl, "marq-timeout", MarqueeCallback, p_sys ); var_AddCallback( p_input, "marq-timeout", MarqueeCallback, p_sys );
vlc_object_release( p_pl ); vlc_object_release( p_input );
/* Misc init */ /* Misc init */
p_filter->pf_sub_filter = Filter; p_filter->pf_sub_filter = Filter;
...@@ -138,22 +138,22 @@ static void DestroyFilter( vlc_object_t *p_this ) ...@@ -138,22 +138,22 @@ static void DestroyFilter( vlc_object_t *p_this )
{ {
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
vlc_object_t *p_pl; vlc_object_t *p_input;
if( p_sys->psz_marquee ) free( p_sys->psz_marquee ); if( p_sys->psz_marquee ) free( p_sys->psz_marquee );
free( p_sys ); free( p_sys );
/* Delete the marquee variables from playlist */ /* Delete the marquee variables from playlist */
p_pl = vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_ANYWHERE );
if( !p_pl ) if( !p_input )
{ {
return; return;
} }
var_Destroy( p_pl , "marq-marquee" ); var_Destroy( p_input , "marq-marquee" );
var_Destroy( p_pl , "marq-x" ); var_Destroy( p_input , "marq-x" );
var_Destroy( p_pl , "marq-y" ); var_Destroy( p_input , "marq-y" );
var_Destroy( p_pl , "marq-timeout" ); var_Destroy( p_input , "marq-timeout" );
vlc_object_release( p_pl ); vlc_object_release( p_input );
} }
/**************************************************************************** /****************************************************************************
......
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