[vlc-devel] commit: Use the access helpers. ( Rémi Duraffort )

git version control git at videolan.org
Fri Jan 16 11:53:58 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Jan 16 11:45:12 2009 +0100| [524810e64e5b1a98003ee51e9a692c47a83210db] | committer: Rémi Duraffort 

Use the access helpers.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=524810e64e5b1a98003ee51e9a692c47a83210db
---

 modules/access/pvr.c  |   21 ++++-----------------
 modules/access/v4l2.c |   19 +++++--------------
 2 files changed, 9 insertions(+), 31 deletions(-)

diff --git a/modules/access/pvr.c b/modules/access/pvr.c
index 13e65cb..737b73f 100644
--- a/modules/access/pvr.c
+++ b/modules/access/pvr.c
@@ -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 );
diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index 72f82d7..517bc1c 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -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 );
 




More information about the vlc-devel mailing list