[vlc-commits] sout rtp: use operation structures
Rémi Denis-Courmont
git at videolan.org
Sat Oct 10 11:46:02 CEST 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 10 12:44:04 2020 +0300| [7ca420538754f2d297f1119163a181e6835da989] | committer: Rémi Denis-Courmont
sout rtp: use operation structures
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7ca420538754f2d297f1119163a181e6835da989
---
modules/stream_out/rtp.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index e01a09127c..30fd5bba4a 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -353,6 +353,14 @@ struct sout_stream_id_sys_t
vlc_tick_t i_caching;
};
+static const struct sout_stream_operations stream_ops = {
+ Add, Del, Send, NULL, NULL,
+};
+
+static const struct sout_stream_operations mux_ops = {
+ MuxAdd, MuxDel, MuxSend, NULL, NULL,
+};
+
/*****************************************************************************
* Open:
*****************************************************************************/
@@ -513,19 +521,13 @@ static int Open( vlc_object_t *p_this )
}
p_sys->packet = NULL;
-
- p_stream->pf_add = MuxAdd;
- p_stream->pf_del = MuxDel;
- p_stream->pf_send = MuxSend;
+ p_stream->ops = &mux_ops;
}
else
{
- p_sys->p_mux = NULL;
- p_sys->p_grab = NULL;
-
- p_stream->pf_add = Add;
- p_stream->pf_del = Del;
- p_stream->pf_send = Send;
+ p_sys->p_mux = NULL;
+ p_sys->p_grab = NULL;
+ p_stream->ops = &stream_ops;
}
p_stream->pace_nocontrol = true;
More information about the vlc-commits
mailing list