[vlc-devel] [PATCH 04/16] avformat: mux: use sout_mux_operations table

Alexandre Janniaux ajanni at videolabs.io
Mon Mar 15 17:02:57 UTC 2021


---
 modules/demux/avformat/mux.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index 658555af50..b0a723cbd0 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -162,10 +162,14 @@ int avformat_OpenMux( vlc_object_t *p_this )
         p_sys->oc->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_ZERO;
 
     /* Fill p_mux fields */
-    p_mux->pf_control   = Control;
-    p_mux->pf_addstream = AddStream;
-    p_mux->pf_delstream = DelStream;
-    p_mux->pf_mux       = Mux;
+    static const struct sout_mux_operations ops =
+    {
+        .control = Control,
+        .add_stream = AddStream,
+        .del_stream = DelStream,
+        .mux = Mux,
+    };
+    p_mux->ops = &ops;
 
     return VLC_SUCCESS;
 }
-- 
2.30.2



More information about the vlc-devel mailing list