Commit 670651ee authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use objet pointer as unique ID (plugins)

(By the way, snapshot-id looks like a write only variable...)
parent 29a0b630
...@@ -604,8 +604,8 @@ static char *GetTmpFilePath( access_t *p_access ) ...@@ -604,8 +604,8 @@ static char *GetTmpFilePath( access_t *p_access )
#endif #endif
} }
if( asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%d-", if( asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%p-",
psz_dir, getpid(), p_access->i_object_id ) == -1 ) psz_dir, getpid(), p_access ) == -1 )
psz_filename_base = NULL; psz_filename_base = NULL;
free( psz_dir ); free( psz_dir );
......
...@@ -82,7 +82,7 @@ int OpenDecoder ( vlc_object_t *p_this ) ...@@ -82,7 +82,7 @@ int OpenDecoder ( vlc_object_t *p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
sprintf( psz_file, "stream.%i", p_dec->i_object_id ); snprintf( psz_file, sizeof( psz_file), "stream.%p", p_dec );
#ifndef UNDER_CE #ifndef UNDER_CE
var_Create( p_dec, "dummy-save-es", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_dec, "dummy-save-es", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
......
...@@ -301,18 +301,18 @@ static int Init( vout_thread_t *p_vout ) ...@@ -301,18 +301,18 @@ static int Init( vout_thread_t *p_vout )
if( var_Create( p_vout->p_sys->p_input, "snapshot-id", VLC_VAR_INTEGER ) ) if( var_Create( p_vout->p_sys->p_input, "snapshot-id", VLC_VAR_INTEGER ) )
{ {
msg_Err( p_vout, "Cannot create snapshot-id variable in p_input (%d).", msg_Err( p_vout, "Cannot create snapshot-id variable in p_input(%p).",
p_vout->p_sys->p_input->i_object_id ); p_vout->p_sys->p_input );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* Register the snapshot vout module at the input level */ /* Register the snapshot vout module at the input level */
val.i_int = p_vout->i_object_id; val.p_address = p_vout;
if( var_Set( p_vout->p_sys->p_input, "snapshot-id", val ) ) if( var_Set( p_vout->p_sys->p_input, "snapshot-id", val ) )
{ {
msg_Err( p_vout, "Cannot register snapshot-id in p_input (%d).", msg_Err( p_vout, "Cannot register snapshot-id in p_input(%p).",
p_vout->p_sys->p_input->i_object_id ); p_vout->p_sys->p_input );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
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