[vlc-commits] sout es: use operation structure

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


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 10 12:39:59 2020 +0300| [9f3bfed53b3a26764492098855b9ebbd70c10a43] | committer: Rémi Denis-Courmont

sout es: use operation structure

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

 modules/stream_out/es.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index 70092e7034..d526024cdc 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -266,6 +266,10 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     return sout_MuxSendBuffer( id->p_mux, id->p_input, p_buffer );
 }
 
+static const struct sout_stream_operations ops = {
+    Add, Del, Send, NULL, NULL,
+};
+
 #define SOUT_CFG_PREFIX "sout-es-"
 
 static const char *const ppsz_sout_options[] = {
@@ -304,11 +308,8 @@ static int Open( vlc_object_t *p_this )
     p_sys->psz_dst_audio = var_GetString( p_stream, SOUT_CFG_PREFIX "dst-audio" );
     p_sys->psz_dst_video = var_GetString( p_stream, SOUT_CFG_PREFIX "dst-video" );
 
-    p_stream->pf_add    = Add;
-    p_stream->pf_del    = Del;
-    p_stream->pf_send   = Send;
-
-    p_stream->p_sys     = p_sys;
+    p_stream->ops = &ops;
+    p_stream->p_sys = p_sys;
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list