[vlc-commits] sout: look up index only once
Rémi Denis-Courmont
git at videolan.org
Mon Feb 26 19:25:21 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Feb 26 20:23:27 2018 +0200| [01c4cd0fcbbcd42844dacc320c62f7d2f7b40270] | committer: Rémi Denis-Courmont
sout: look up index only once
TAB_REMOVE would do a second look-up then call TAB_REMOVE.
Call TAB_REMOVE directly.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01c4cd0fcbbcd42844dacc320c62f7d2f7b40270
---
src/stream_output/stream_output.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 80320160a5..bdfeb24f20 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -503,10 +503,10 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
TAB_FIND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input, i_index );
if( i_index >= 0 )
{
- p_mux->pf_delstream( p_mux, p_input );
-
/* remove the entry */
- TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
+ TAB_ERASE( p_mux->i_nb_inputs, p_mux->pp_inputs, i_index );
+
+ p_mux->pf_delstream( p_mux, p_input );
if( p_mux->i_nb_inputs == 0 )
{
More information about the vlc-commits
mailing list