diff flacenc.c @ 9448:f2835afa516a libavcodec

flacenc: write initial blocksize to STREAMINFO header instead of current blocksize.
author jbr
date Thu, 16 Apr 2009 02:28:49 +0000
parents c9fda17dc042
children 266bf83f634d
line wrap: on
line diff
--- a/flacenc.c	Wed Apr 15 19:37:35 2009 +0000
+++ b/flacenc.c	Thu Apr 16 02:28:49 2009 +0000
@@ -83,6 +83,7 @@
     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 @@
     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 @@
     } 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 */