[vlc-devel] commit: smem: try not to re-create the variables too many times. ( Rémi Duraffort )
git version control
git at videolan.org
Sat Oct 10 11:57:44 CEST 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Oct 2 19:56:05 2009 +0200| [a780f4106a556cb08f2e2c79b39634a9ad167880] | committer: Rémi Duraffort
smem: try not to re-create the variables too many times.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a780f4106a556cb08f2e2c79b39634a9ad167880
---
modules/stream_out/smem.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index b9a0958..236639d 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -179,6 +179,10 @@ static int Open( vlc_object_t *p_this )
p_sys->pf_audio_postrender_callback = (void (*) (void*, uint8_t*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int))(intptr_t)atoll( psz_tmp );
free( psz_tmp );
+ /* Create the remaining variables for a later use */
+ var_Create( p_stream, SOUT_PREFIX_VIDEO "data", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Create( p_stream, SOUT_PREFIX_AUDIO "data", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+
/* Setting stream out module callbacks */
p_stream->pf_add = Add;
p_stream->pf_del = Del;
@@ -250,7 +254,7 @@ static sout_stream_id_t *AddVideo( sout_stream_t *p_stream, es_format_t *p_fmt )
if( !id )
return NULL;
- psz_tmp = var_CreateGetString( p_stream, SOUT_PREFIX_VIDEO "data" );
+ psz_tmp = var_GetString( p_stream, SOUT_PREFIX_VIDEO "data" );
id->p_data = (void *)( intptr_t )atoll( psz_tmp );
free( psz_tmp );
@@ -301,7 +305,7 @@ static sout_stream_id_t *AddAudio( sout_stream_t *p_stream, es_format_t *p_fmt )
if( !id )
return NULL;
- psz_tmp = var_CreateGetString( p_stream, SOUT_PREFIX_AUDIO "data" );
+ psz_tmp = var_GetString( p_stream, SOUT_PREFIX_AUDIO "data" );
id->p_data = (void *)( intptr_t )atoll( psz_tmp );
free( psz_tmp );
More information about the vlc-devel
mailing list