[vlc-commits] sout display: use operation structure

Rémi Denis-Courmont git at videolan.org
Sat Oct 10 11:45:59 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 10 12:38:36 2020 +0300| [52c923a045b08333a4084c8b8c3b77a9b665c3a3] | committer: Rémi Denis-Courmont

sout display: use operation structure

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

 modules/stream_out/display.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/display.c b/modules/stream_out/display.c
index ed774293c1..d91ba8af24 100644
--- a/modules/stream_out/display.c
+++ b/modules/stream_out/display.c
@@ -154,6 +154,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:
  *****************************************************************************/
@@ -180,10 +184,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_video = var_GetBool( p_stream, SOUT_CFG_PREFIX "video" );
     p_sys->i_delay = VLC_TICK_FROM_MS( var_GetInteger( p_stream, SOUT_CFG_PREFIX "delay" ) );
 
-    p_stream->pf_add    = Add;
-    p_stream->pf_del    = Del;
-    p_stream->pf_send   = Send;
-    p_stream->pf_control = Control;
+    p_stream->ops = &ops;
     p_stream->p_sys     = p_sys;
     p_stream->pace_nocontrol = true;
 



More information about the vlc-commits mailing list