Revision 54f158bd libavcodec/aac.c

View differences:

libavcodec/aac.c
509 509
    int i;
510 510

  
511 511
    ac->avccontext = avccontext;
512
    ac->m4ac.sample_rate = avccontext->sample_rate;
512 513

  
513 514
    if (avccontext->extradata_size > 0) {
514 515
        if (decode_audio_specific_config(ac, avccontext->extradata, avccontext->extradata_size))
515 516
            return -1;
516
        avccontext->sample_rate = ac->m4ac.sample_rate;
517
    } else if (avccontext->channels > 0) {
518
        ac->m4ac.sample_rate = avccontext->sample_rate;
519 517
    }
520 518

  
521 519
    avccontext->sample_fmt = SAMPLE_FMT_S16;
522
    avccontext->frame_size = 1024;
523 520

  
524 521
    AAC_INIT_VLC_STATIC( 0, 304);
525 522
    AAC_INIT_VLC_STATIC( 1, 270);
......
1950 1947
    enum RawDataBlockType elem_type;
1951 1948
    int err, elem_id, data_size_tmp;
1952 1949
    int buf_consumed;
1950
    int samples = 1024, multiplier;
1953 1951

  
1954 1952
    init_get_bits(&gb, buf, buf_size * 8);
1955 1953

  
......
2036 2034

  
2037 2035
    spectral_to_sample(ac);
2038 2036

  
2037
    multiplier = 1;
2038
    samples <<= multiplier;
2039
    if (ac->output_configured < OC_LOCKED) {
2040
        avccontext->sample_rate = ac->m4ac.sample_rate << multiplier;
2041
        avccontext->frame_size = samples;
2042
    }
2043

  
2039 2044
    data_size_tmp = 1024 * avccontext->channels * sizeof(int16_t);
2040 2045
    if (*data_size < data_size_tmp) {
2041 2046
        av_log(avccontext, AV_LOG_ERROR,

Also available in: Unified diff