[FFmpeg-cvslog] r18532 - trunk/libavcodec/flacenc.c

jbr subversion
Thu Apr 16 04:28:50 CEST 2009


Author: jbr
Date: Thu Apr 16 04:28:49 2009
New Revision: 18532

Log:
flacenc: write initial blocksize to STREAMINFO header instead of current 
blocksize.

Modified:
   trunk/libavcodec/flacenc.c

Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c	Thu Apr 16 02:41:31 2009	(r18531)
+++ trunk/libavcodec/flacenc.c	Thu Apr 16 04:28:49 2009	(r18532)
@@ -83,6 +83,7 @@ typedef struct FlacEncodeContext {
     int channels;
     int samplerate;
     int sr_code[2];
+    int max_blocksize;
     int min_framesize;
     int max_framesize;
     int max_encoded_framesize;
@@ -107,8 +108,8 @@ static void write_streaminfo(FlacEncodeC
     init_put_bits(&pb, header, FLAC_STREAMINFO_SIZE);
 
     /* streaminfo metadata block */
-    put_bits(&pb, 16, s->avctx->frame_size);
-    put_bits(&pb, 16, s->avctx->frame_size);
+    put_bits(&pb, 16, s->max_blocksize);
+    put_bits(&pb, 16, s->max_blocksize);
     put_bits(&pb, 24, s->min_framesize);
     put_bits(&pb, 24, s->max_framesize);
     put_bits(&pb, 20, s->samplerate);
@@ -326,6 +327,7 @@ static av_cold int flac_encode_init(AVCo
     } else {
         s->avctx->frame_size = select_blocksize(s->samplerate, s->options.block_time_ms);
     }
+    s->max_blocksize = s->avctx->frame_size;
     av_log(avctx, AV_LOG_DEBUG, " block size: %d\n", s->avctx->frame_size);
 
     /* set LPC precision */



More information about the ffmpeg-cvslog mailing list