[vlc-commits] v4l2: put controls on the parent

Rémi Denis-Courmont git at videolan.org
Mon Mar 4 16:53:48 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar  4 17:35:55 2019 +0200| [dba3a4e5df324ea33f909d896a663b7a0234a309] | committer: Rémi Denis-Courmont

v4l2: put controls on the parent

This is not exactly great, and it (still) will not work properly if
there are more than one demux with controls on a single input.

But at least it does not rely on racy walking of the objects tree
and matching object name, nor racy usage vlc_object_t public members.

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

 modules/access/v4l2/access.c | 4 ++--
 modules/access/v4l2/demux.c  | 4 ++--
 modules/access/v4l2/radio.c  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/access/v4l2/access.c b/modules/access/v4l2/access.c
index 488838d627..d3c31385f0 100644
--- a/modules/access/v4l2/access.c
+++ b/modules/access/v4l2/access.c
@@ -86,7 +86,7 @@ int AccessOpen( vlc_object_t *obj )
         goto error;
     }
 
-    sys->controls = ControlsInit (VLC_OBJECT(access), fd);
+    sys->controls = ControlsInit(vlc_object_parent(obj), fd);
     access->pf_seek = NULL;
     access->pf_control = AccessControl;
     return VLC_SUCCESS;
@@ -192,7 +192,7 @@ void AccessClose( vlc_object_t *obj )
 
     if (sys->bufv != NULL)
         StopMmap (sys->fd, sys->bufv, sys->bufc);
-    ControlsDeinit( obj, sys->controls );
+    ControlsDeinit(vlc_object_parent(obj), sys->controls);
     v4l2_close (sys->fd);
     free( sys );
 }
diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index f6b44b91f1..00f02ee76e 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -103,7 +103,7 @@ int DemuxOpen( vlc_object_t *obj )
         goto error;
     }
 
-    sys->controls = ControlsInit (VLC_OBJECT(demux), fd);
+    sys->controls = ControlsInit(vlc_object_parent(obj), fd);
     sys->start = vlc_tick_now ();
     demux->pf_demux = NULL;
     demux->pf_control = DemuxControl;
@@ -623,7 +623,7 @@ void DemuxClose( vlc_object_t *obj )
     vlc_join (sys->thread, NULL);
     if (sys->bufv != NULL)
         StopMmap (sys->fd, sys->bufv, sys->bufc);
-    ControlsDeinit( obj, sys->controls );
+    ControlsDeinit(vlc_object_parent(obj), sys->controls);
     v4l2_close (sys->fd);
 
 #ifdef ZVBI_COMPILED
diff --git a/modules/access/v4l2/radio.c b/modules/access/v4l2/radio.c
index 6df6c35ce7..59204aad82 100644
--- a/modules/access/v4l2/radio.c
+++ b/modules/access/v4l2/radio.c
@@ -100,7 +100,7 @@ int RadioOpen (vlc_object_t *obj)
         goto error;
 
     sys->fd = fd;
-    sys->controls = ControlsInit (VLC_OBJECT(demux), fd);
+    sys->controls = ControlsInit(vlc_object_parent(obj), fd);
     sys->start = vlc_tick_now ();
 
     demux->p_sys = sys;
@@ -118,7 +118,7 @@ void RadioClose (vlc_object_t *obj)
     demux_t *demux = (demux_t *)obj;
     demux_sys_t *sys = demux->p_sys;
 
-    ControlsDeinit (obj, sys->controls);
+    ControlsDeinit(vlc_object_parent(obj), sys->controls);
     v4l2_close (sys->fd);
     free (sys);
 }



More information about the vlc-commits mailing list