]> git.sesse.net Git - vlc/commitdiff
* modules/codec/speex.c: fixed a couple of bugs.
authorGildas Bazin <gbazin@videolan.org>
Wed, 22 Oct 2003 18:24:08 +0000 (18:24 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 22 Oct 2003 18:24:08 +0000 (18:24 +0000)
modules/codec/speex.c

index 4c35300a9741df736d09bc4ddac692fa80cc925e..ec1c733076a9e88bfa85318851420ea809f7c932 100755 (executable)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * speex.c: speex decoder module making use of libspeex.
+ * speex.c: speex decoder/packetizer module making use of libspeex.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: speex.c,v 1.1 2003/10/22 17:12:30 gbazin Exp $
+ * $Id: speex.c,v 1.2 2003/10/22 18:24:08 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -217,6 +217,7 @@ static int RunDecoder( decoder_t *p_dec, block_t *p_block )
         if( ProcessHeader( p_dec, &oggpacket ) != VLC_SUCCESS )
         {
             msg_Err( p_dec, "Initial Speex header is corrupted" );
+            block_Release( p_block );
             return VLC_EGENERIC;
         }
 
@@ -359,7 +360,7 @@ static int ProcessHeader( decoder_t *p_dec, ogg_packet *p_oggpacket )
         return VLC_EGENERIC;
     }
 
-    if( p_header->nb_channels == 1 )
+    if( p_header->nb_channels == 2 )
     {
         SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT;
         p_sys->stereo = stereo;
@@ -470,6 +471,7 @@ static int DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
         aout_DecPlay( p_sys->p_aout, p_sys->p_aout_input, p_aout_buffer );
     }
 
+    return VLC_SUCCESS;
 }
 
 /*****************************************************************************