* transcode: fix about raw audio.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 2 May 2003 19:37:08 +0000 (19:37 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 2 May 2003 19:37:08 +0000 (19:37 +0000)
modules/stream_out/transcode.c

index 5d27700..c2d047c 100644 (file)
@@ -2,7 +2,7 @@
  * transcode.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.8 2003/05/02 16:25:12 fenrir Exp $
+ * $Id: transcode.c,v 1.9 2003/05/02 19:37:08 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -679,6 +679,7 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
             int     i_samples = __MIN( ( id->i_buffer - id->i_buffer_pos ) / 2, id->i_buffer_in_pos / 2);
 #ifdef WORDS_BIGENDIAN
             uint8_t *sin = (uint8_t*)id->p_buffer_in;
+            i_used = i_samples * 2;
             while( i_samples > 0 )
             {
                 uint8_t tmp[2];
@@ -692,8 +693,8 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
 #else
             memcpy( sout, id->p_buffer_in, i_samples * 2 );
             sout += i_samples;
-#endif
             i_used = i_samples * 2;
+#endif
         }
         else if( id->f_src.i_fourcc == VLC_FOURCC( 's', '1', '6', 'b' ) )
         {
@@ -701,8 +702,10 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
 #ifdef WORDS_BIGENDIAN
             memcpy( sout, id->p_buffer_in, i_samples * 2 );
             sout += i_samples;
+            i_used = i_samples * 2;
 #else
             uint8_t *sin = (uint8_t*)id->p_buffer_in;
+            i_used = i_samples * 2;
             while( i_samples > 0 )
             {
                 uint8_t tmp[2];
@@ -713,7 +716,6 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
                 i_samples--;
             }
 #endif
-            i_used = i_samples * 2;
         }
 
         id->i_buffer_pos = (uint8_t*)sout - id->p_buffer;