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 )
memset( &device_capability, 0, sizeof(struct v4l2_capability) );
p_access->pf_read = Read;
p_access->pf_block = NULL;
p_access->pf_seek = NULL;
p_access->pf_control = Control;
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;
access_InitFields( p_access );
ACCESS_SET_CALLBACKS( Read, NULL, Control, NULL );
p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ));
if( !p_sys ) return VLC_ENOMEM;
/* defaults values */
var_Create( p_access, "pvr-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
......
......@@ -990,20 +990,11 @@ static int AccessOpen( vlc_object_t * p_this )
/* Only when selected */
if( *p_access->psz_access == '\0' ) return VLC_EGENERIC;
p_access->pf_read = AccessRead;
p_access->pf_block = NULL;
p_access->pf_seek = NULL;
p_access->pf_control = AccessControl;
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;
p_sys = calloc( 1, sizeof( demux_sys_t ) );
p_access->p_sys = (access_sys_t *) p_sys;
if( p_sys == NULL ) return VLC_ENOMEM;
access_InitFields( p_access );
ACCESS_SET_CALLBACKS( AccessRead, NULL, AccessControl, NULL );
p_sys = calloc( 1, sizeof( demux_sys_t ));
if( !p_sys ) return VLC_ENOMEM;
p_access->p_sys = (access_sys_t*)p_sys;
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