]> git.sesse.net Git - vlc/commitdiff
* adpcm: bug fixes.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 23 Nov 2003 04:58:00 +0000 (04:58 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 23 Nov 2003 04:58:00 +0000 (04:58 +0000)
modules/codec/adpcm.c

index e16c4a948abfd5e966d8ffbde19ac8a3a4096fe2..fd13c66d8dc7e554bf4552204a2b937df22ca40b 100644 (file)
@@ -2,7 +2,7 @@
  * adpcm.c : adpcm variant audio decoder
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: adpcm.c,v 1.17 2003/11/22 23:39:14 fenrir Exp $
+ * $Id: adpcm.c,v 1.18 2003/11/23 04:58:00 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -178,12 +178,16 @@ static int OpenDecoder( vlc_object_t *p_this )
             break;
     }
 
-    if( 1 )//( p_sys->i_block = p_wf->nBlockAlign ) <= 0 )
+    if( p_dec->fmt_in.audio.i_blockalign <= 0 )
     {
         p_sys->i_block = (p_sys->codec == ADPCM_IMA_QT) ?
             34 * p_dec->fmt_in.audio.i_channels : 1024;
         msg_Warn( p_dec, "block size undefined, -> using %d", p_sys->i_block );
     }
+    else
+    {
+        p_sys->i_block = p_dec->fmt_in.audio.i_blockalign;
+    }
 
     /* calculate samples per block */
     switch( p_sys->codec )
@@ -301,8 +305,8 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             break;
         }
 
-        p_block->p_buffer += p_out->i_nb_bytes;
-        p_block->i_buffer -= p_out->i_nb_bytes;
+        p_block->p_buffer += p_sys->i_block;
+        p_block->i_buffer -= p_sys->i_block;
         return p_out;
     }