From: jbr Date: Thu, 16 Apr 2009 02:28:49 +0000 (+0000) Subject: flacenc: write initial blocksize to STREAMINFO header instead of current X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/380675e84f13e8fcaba65599c8518a57cbbdf878?hp=421cb7793c418cbb0fb7dea81f71a4ad7ab1fe8b flacenc: write initial blocksize to STREAMINFO header instead of current blocksize. git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18532 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index e8e5674bc..66e5bfafc 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -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(FlacEncodeContext *s, uint8_t *header) 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(AVCodecContext *avctx) } 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 */