[vlc-commits] [Git][videolan/vlc][master] mux/wav: remove deprecated block_FifoCount use

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Jul 7 20:04:19 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
22daa904 by Ilkka Ollakka at 2023-07-07T19:50:03+00:00
mux/wav: remove deprecated block_FifoCount use

dequeue whole fifo at once, so we don't need to poll/lock fifo with each
packet.

Also mark each block next packet NULL, as we don't reorder whole chain,
only current block. And we don't want to pass whole chain to
sout_AccessOutWrite.

- - - - -


1 changed file:

- modules/mux/wav.c


Changes:

=====================================
modules/mux/wav.c
=====================================
@@ -264,9 +264,13 @@ static int Mux( sout_mux_t *p_mux )
     p_sys->b_header = false;
 
     p_input = p_mux->pp_inputs[0];
-    while( block_FifoCount( p_input->p_fifo ) > 0 )
+
+    vlc_fifo_Lock( p_input->p_fifo );
+    block_t *p_block = vlc_fifo_DequeueAllUnlocked( p_input->p_fifo );
+    vlc_fifo_Unlock( p_input->p_fifo );
+
+    while( p_block != NULL)
     {
-        block_t *p_block = block_FifoGet( p_input->p_fifo );
         p_sys->i_data += p_block->i_buffer;
 
         /* Do the channel reordering */
@@ -275,7 +279,13 @@ static int Mux( sout_mux_t *p_mux )
                                  p_sys->i_chans_to_reorder,
                                  p_sys->pi_chan_table, p_input->p_fmt->i_codec );
 
+        /* We should not pass whole blockchain to accessoutwrite, as we only handled
+           current block channel reordering, so mark next as empty and handle next block separately
+           */
+        block_t *p_next_block = p_block->p_next;
+        p_block->p_next = NULL;
         sout_AccessOutWrite( p_mux->p_access, p_block );
+        p_block = p_next_block;
     }
 
     return VLC_SUCCESS;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/22daa9048968f8ad62d6144e6e3f7f83656f98f2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/22daa9048968f8ad62d6144e6e3f7f83656f98f2
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list