[vlc-commits] delay: use operation structure

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


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

delay: use operation structure

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

 modules/stream_out/delay.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/stream_out/delay.c b/modules/stream_out/delay.c
index cba884d165..40e612ee1b 100644
--- a/modules/stream_out/delay.c
+++ b/modules/stream_out/delay.c
@@ -86,6 +86,10 @@ static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
     return sout_StreamIdSend( p_stream->p_next, id, p_buffer );
 }
 
+static const struct sout_stream_operations ops = {
+    Add, Del, Send, NULL, NULL,
+};
+
 static const char *ppsz_sout_options[] = {
     "id", "delay", NULL
 };
@@ -109,12 +113,8 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_id = var_GetInteger( p_stream, SOUT_CFG_PREFIX "id" );
     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->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