[vlc-commits] duplicate: use operation structure

Rémi Denis-Courmont git at videolan.org
Sat Oct 10 18:07:01 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 10 19:04:40 2020 +0300| [673fa6e27a5f8103539429cf39132f3eb75686b7] | committer: Rémi Denis-Courmont

duplicate: use operation structure

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

 modules/stream_out/duplicate.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/stream_out/duplicate.c b/modules/stream_out/duplicate.c
index 516a852d18..dc931ca4b1 100644
--- a/modules/stream_out/duplicate.c
+++ b/modules/stream_out/duplicate.c
@@ -103,6 +103,10 @@ static int Control( sout_stream_t *p_stream, int i_query, va_list args )
     return VLC_EGENERIC;
 }
 
+static const struct sout_stream_operations ops = {
+    Add, Del, Send, Control, NULL,
+};
+
 /*****************************************************************************
  * Open:
  *****************************************************************************/
@@ -173,13 +177,8 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    p_stream->pf_add    = Add;
-    p_stream->pf_del    = Del;
-    p_stream->pf_send   = Send;
-    p_stream->pf_control = Control;
-
-    p_stream->p_sys     = p_sys;
-
+    p_stream->p_sys = p_sys;
+    p_stream->ops = &ops;
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list