[vlc-commits] [Git][videolan/vlc][master] 2 commits: araw: factorize decoder_UpdateAudioFormat() call

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Nov 20 14:28:03 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ee9ec5f4 by Steve Lhomme at 2026-11-20T11:26:34+00:00
araw: factorize decoder_UpdateAudioFormat() call

- - - - -
7f0d5b95 by Steve Lhomme at 2026-11-20T11:26:34+00:00
araw: add a comment on formats that don't need decoding/encoding callbacks

- - - - -


1 changed file:

- modules/codec/araw.c


Changes:

=====================================
modules/codec/araw.c
=====================================
@@ -335,10 +335,10 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     if( samples == 0 )
         goto skip;
 
+    if( decoder_UpdateAudioFormat( p_dec ) )
+        goto skip;
     if( p_sys->decode != NULL )
     {
-        if( decoder_UpdateAudioFormat( p_dec ) )
-            goto skip;
         block_t *p_out = decoder_NewAudioBuffer( p_dec, samples );
         if( p_out == NULL )
             goto skip;
@@ -348,10 +348,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
         block_Release( p_block );
         p_block = p_out;
     }
-    else
+    else // VLC_CODEC_S32N | VLC_CODEC_S16N | VLC_CODEC_U8
     {
-        if( decoder_UpdateAudioFormat( p_dec ) )
-            goto skip;
         p_block->i_nb_samples = samples;
         p_block->i_buffer = samples * (p_sys->framebits / 8);
     }
@@ -797,7 +795,7 @@ static block_t *Encode( encoder_t *enc, block_t *in )
     if( encode != NULL )
         encode( out->p_buffer, in->p_buffer, in->i_nb_samples
                                              * enc->fmt_out.audio.i_channels );
-    else {
+    else { // VLC_CODEC_S32N | VLC_CODEC_S16N | VLC_CODEC_U8
         assert( out->i_buffer >= in->i_buffer );
         memcpy( out->p_buffer, in->p_buffer, in->i_buffer );
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/956dda12b5d8ebe577bf82b3eadf8f88ad4816b3...7f0d5b9562183968a151de7de4d9ac0353a462ba

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/956dda12b5d8ebe577bf82b3eadf8f88ad4816b3...7f0d5b9562183968a151de7de4d9ac0353a462ba
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list