Revision 6682ae42

View differences:

libavcodec/flacenc.c
95 95
    int ch_code;
96 96
    int samplerate;
97 97
    int sr_code[2];
98
    int min_framesize;
99
    int min_encoded_framesize;
98 100
    int max_framesize;
101
    int max_encoded_framesize;
99 102
    uint32_t frame_count;
100 103
    uint64_t sample_count;
101 104
    uint8_t md5sum[16];
......
133 136
    /* streaminfo metadata block */
134 137
    put_bits(&pb, 16, s->avctx->frame_size);
135 138
    put_bits(&pb, 16, s->avctx->frame_size);
136
    put_bits(&pb, 24, 0);
139
    put_bits(&pb, 24, s->min_framesize);
137 140
    put_bits(&pb, 24, s->max_framesize);
138 141
    put_bits(&pb, 20, s->samplerate);
139 142
    put_bits(&pb, 3, s->channels-1);
......
374 377
    } else {
375 378
        s->max_framesize = 14 + (s->avctx->frame_size * s->channels * 2);
376 379
    }
380
    s->min_encoded_framesize = 0xFFFFFF;
377 381

  
378 382
    /* initialize MD5 context */
379 383
    s->md5ctx = av_malloc(av_md5_size);
......
1278 1282

  
1279 1283
    /* when the last block is reached, update the header in extradata */
1280 1284
    if (!data) {
1285
        s->min_framesize = s->min_encoded_framesize;
1286
        s->max_framesize = s->max_encoded_framesize;
1281 1287
        av_md5_final(s->md5ctx, s->md5sum);
1282 1288
        write_streaminfo(s, avctx->extradata);
1283 1289
        return 0;
......
1318 1324
    s->frame_count++;
1319 1325
    s->sample_count += avctx->frame_size;
1320 1326
    update_md5_sum(s, samples);
1327
    if (out_bytes > s->max_encoded_framesize)
1328
        s->max_encoded_framesize = out_bytes;
1329
    if (out_bytes < s->min_encoded_framesize)
1330
        s->min_encoded_framesize = out_bytes;
1321 1331

  
1322 1332
    return out_bytes;
1323 1333
}
tests/ffmpeg.regression.ref
201 201
267073 ./tests/data/a-adpcm_swf.flv
202 202
e48b800e2d9be6afcd430d4f08a34eb6 *./tests/data/adpcm_swf.vsynth.out.wav
203 203
stddev:  934.28 PSNR: 36.91 bytes:  1056812/  1058444
204
10a8bf5796004b150c7aed115cbafef5 *./tests/data/a-flac.flac
204
7781a016edfc242a39e4d65af02d861a *./tests/data/a-flac.flac
205 205
353368 ./tests/data/a-flac.flac
206 206
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/flac.vsynth.out.wav
207 207
stddev:    0.00 PSNR:999.99 bytes:  1058444/  1058444
tests/rotozoom.regression.ref
201 201
267073 ./tests/data/a-adpcm_swf.flv
202 202
e48b800e2d9be6afcd430d4f08a34eb6 *./tests/data/adpcm_swf.rotozoom.out.wav
203 203
stddev:  934.28 PSNR: 36.91 bytes:  1056812/  1058444
204
10a8bf5796004b150c7aed115cbafef5 *./tests/data/a-flac.flac
204
7781a016edfc242a39e4d65af02d861a *./tests/data/a-flac.flac
205 205
353368 ./tests/data/a-flac.flac
206 206
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/flac.rotozoom.out.wav
207 207
stddev:    0.00 PSNR:999.99 bytes:  1058444/  1058444

Also available in: Unified diff