[vlc-devel] [PATCH] mux: dummy: use vlc_fifo functions
Alexandre Janniaux
ajanni at videolabs.io
Sun Jan 31 19:52:43 UTC 2021
Fix a deprecation warnings on block_Fifo* functions and avoid locking
multiple times and calling the access output function multiple times.
---
modules/mux/dummy.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/modules/mux/dummy.c b/modules/mux/dummy.c
index d9600f41e9..226f49846b 100644
--- a/modules/mux/dummy.c
+++ b/modules/mux/dummy.c
@@ -140,7 +140,6 @@ static int Mux( sout_mux_t *p_mux )
for( i = 0; i < p_mux->i_nb_inputs; i++ )
{
block_fifo_t *p_fifo;
- int i_count;
if( p_sys->b_header && p_mux->pp_inputs[i]->p_fmt->i_extra )
{
@@ -158,15 +157,13 @@ static int Mux( sout_mux_t *p_mux )
}
p_fifo = p_mux->pp_inputs[i]->p_fifo;
- i_count = block_FifoCount( p_fifo );
- while( i_count > 0 )
- {
- block_t *p_data = block_FifoGet( p_fifo );
- sout_AccessOutWrite( p_mux->p_access, p_data );
+ vlc_fifo_Lock( p_fifo );
+ block_t *blockchain = vlc_fifo_DequeueAllUnlocked( p_fifo );
+ vlc_fifo_Unlock( p_fifo );
- i_count--;
- }
+ if( blockchain )
+ sout_AccessOutWrite( p_mux->p_access, blockchain );
}
p_sys->b_header = false;
--
2.30.0
More information about the vlc-devel
mailing list