[FFmpeg-soc] [soc]: r2442 - alacenc/alacenc.c

jai_menon subversion at mplayerhq.hu
Sun Jun 15 05:15:54 CEST 2008


Author: jai_menon
Date: Sun Jun 15 05:15:54 2008
New Revision: 2442

Log:
fix verbatim mode

Modified:
   alacenc/alacenc.c

Modified: alacenc/alacenc.c
==============================================================================
--- alacenc/alacenc.c	(original)
+++ alacenc/alacenc.c	Sun Jun 15 05:15:54 2008
@@ -275,18 +275,17 @@ static int alac_encode_frame(AVCodecCont
         return -1;
     }
 
-    init_sample_buffers(s, data);
-
     init_put_bits(pb, frame, buf_size);
     write_frame_header(s);
 
     if(s->compression_level == 0) {
         // Verbatim mode
-        for(ch=0; ch<s->channels; ch++) {
-            for(i=0; i<avctx->frame_size; i++)
-                put_sbits(pb, 16, s->sample_buf[ch][i]);
+        int16_t *samples = data;
+        for(i=0; i<avctx->frame_size*s->channels; i++) {
+            put_sbits(pb, 16, *samples++);
         }
     } else {
+        init_sample_buffers(s, data);
         write_compressed_frame(s);
     }
 



More information about the FFmpeg-soc mailing list