Commit 524810e6 authored by Rémi Duraffort's avatar Rémi Duraffort

Use the access helpers.

parent 81c3ec4d
...@@ -553,23 +553,10 @@ static int Open( vlc_object_t * p_this ) ...@@ -553,23 +553,10 @@ static int Open( vlc_object_t * p_this )
memset( &device_capability, 0, sizeof(struct v4l2_capability) ); memset( &device_capability, 0, sizeof(struct v4l2_capability) );
p_access->pf_read = Read; access_InitFields( p_access );
p_access->pf_block = NULL; ACCESS_SET_CALLBACKS( Read, NULL, Control, NULL );
p_access->pf_seek = NULL; p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ));
p_access->pf_control = Control; if( !p_sys ) return VLC_ENOMEM;
p_access->info.i_update = 0;
p_access->info.i_size = 0;
p_access->info.i_pos = 0;
p_access->info.b_eof = false;
p_access->info.i_title = 0;
p_access->info.i_seekpoint = 0;
/* create private access data */
p_sys = calloc( sizeof( access_sys_t ), 1 );
if( !p_sys )
return VLC_ENOMEM;
p_access->p_sys = p_sys;
/* defaults values */ /* defaults values */
var_Create( p_access, "pvr-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "pvr-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
......
...@@ -990,20 +990,11 @@ static int AccessOpen( vlc_object_t * p_this ) ...@@ -990,20 +990,11 @@ static int AccessOpen( vlc_object_t * p_this )
/* Only when selected */ /* Only when selected */
if( *p_access->psz_access == '\0' ) return VLC_EGENERIC; if( *p_access->psz_access == '\0' ) return VLC_EGENERIC;
p_access->pf_read = AccessRead; access_InitFields( p_access );
p_access->pf_block = NULL; ACCESS_SET_CALLBACKS( AccessRead, NULL, AccessControl, NULL );
p_access->pf_seek = NULL; p_sys = calloc( 1, sizeof( demux_sys_t ));
p_access->pf_control = AccessControl; if( !p_sys ) return VLC_ENOMEM;
p_access->info.i_update = 0; p_access->p_sys = (access_sys_t*)p_sys;
p_access->info.i_size = 0;
p_access->info.i_pos = 0;
p_access->info.b_eof = false;
p_access->info.i_title = 0;
p_access->info.i_seekpoint = 0;
p_sys = calloc( 1, sizeof( demux_sys_t ) );
p_access->p_sys = (access_sys_t *) p_sys;
if( p_sys == NULL ) return VLC_ENOMEM;
GetV4L2Params( p_sys, (vlc_object_t *) p_access ); GetV4L2Params( p_sys, (vlc_object_t *) p_access );
......
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