Revision b8c4a515

View differences:

libavcodec/atrac3.c
409 409
 * Restore the quantized tonal components
410 410
 *
411 411
 * @param gb            the GetBit context
412
 * @param numComponents tonal components to report back
413 412
 * @param pComponent    tone component
414 413
 * @param numBands      amount of coded bands
415 414
 */
416 415

  
417
static int decodeTonalComponents (GetBitContext *gb, int *numComponents, tonal_component *pComponent, int numBands)
416
static int decodeTonalComponents (GetBitContext *gb, tonal_component *pComponent, int numBands)
418 417
{
419 418
    int i,j,k,cnt;
420
    int   component_count, components, coding_mode_selector, coding_mode, coded_values_per_component;
419
    int   components, coding_mode_selector, coding_mode, coded_values_per_component;
421 420
    int   sfIndx, coded_values, max_coded_values, quant_step_index, coded_components;
422 421
    int   band_flags[4], mantissa[8];
423 422
    float  *pCoef;
424 423
    float  scalefactor;
425

  
426
    component_count = 0;
427
    *numComponents = 0;
424
    int   component_count = 0;
428 425

  
429 426
    components = get_bits(gb,5);
430 427

  
......
480 477
        }
481 478
    }
482 479

  
483
    *numComponents = component_count;
484

  
485
    return 0;
480
    return component_count;
486 481
}
487 482

  
488 483
/**
......
739 734
    result = decodeGainControl (gb, &(pSnd->gainBlock[pSnd->gcBlkSwitch]), pSnd->bandsCoded);
740 735
    if (result) return result;
741 736

  
742
    result = decodeTonalComponents (gb, &pSnd->numComponents, pSnd->components, pSnd->bandsCoded);
743
    if (result) return result;
737
    pSnd->numComponents = decodeTonalComponents (gb, pSnd->components, pSnd->bandsCoded);
738
    if (pSnd->numComponents == -1) return -1;
744 739

  
745 740
    numSubbands = decodeSpectrum (gb, pSnd->spectrum);
746 741

  

Also available in: Unified diff