[vlc-commits] sout record: use operation structure

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


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

sout record: use operation structure

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

 modules/stream_out/record.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index ce2ce958e7..1f8560302c 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -114,6 +114,10 @@ typedef struct
 static void OutputStart( sout_stream_t *p_stream );
 static void OutputSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t * );
 
+static const struct sout_stream_operations ops = {
+    Add, Del, Send, NULL, NULL,
+};
+
 /*****************************************************************************
  * Open:
  *****************************************************************************/
@@ -122,9 +126,7 @@ static int Open( vlc_object_t *p_this )
     sout_stream_t *p_stream = (sout_stream_t*)p_this;
     sout_stream_sys_t *p_sys;
 
-    p_stream->pf_add    = Add;
-    p_stream->pf_del    = Del;
-    p_stream->pf_send   = Send;
+    p_stream->ops = &ops;
 
     p_stream->p_sys = p_sys = malloc( sizeof(*p_sys) );
     if( !p_sys )



More information about the vlc-commits mailing list