Revision ff5d419e

View differences:

libavcodec/ac3dec.c
466 466
 * Get the transform coefficients for a particular channel
467 467
 * reference: Section 7.3 Quantization and Decoding of Mantissas
468 468
 */
469
static int get_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, mant_groups *m)
469
static void get_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, mant_groups *m)
470 470
{
471 471
    GetBitContext *gbc = &s->gbc;
472 472
    int i, gcode, tbap, start, end;
......
536 536
        }
537 537
        coeffs[i] >>= exps[i];
538 538
    }
539

  
540
    return 0;
541 539
}
542 540

  
543 541
/**
......
576 574
/**
577 575
 * Get the transform coefficients.
578 576
 */
579
static int get_transform_coeffs(AC3DecodeContext *s)
577
static void get_transform_coeffs(AC3DecodeContext *s)
580 578
{
581 579
    int ch, end;
582 580
    int got_cplchan = 0;
......
586 584

  
587 585
    for (ch = 1; ch <= s->channels; ch++) {
588 586
        /* transform coefficients for full-bandwidth channel */
589
        if (get_transform_coeffs_ch(s, ch, &m))
590
            return -1;
587
        get_transform_coeffs_ch(s, ch, &m);
591 588
        /* tranform coefficients for coupling channel come right after the
592 589
           coefficients for the first coupled channel*/
593 590
        if (s->channel_in_cpl[ch])  {
594 591
            if (!got_cplchan) {
595
                if (get_transform_coeffs_ch(s, CPL_CH, &m)) {
596
                    av_log(s->avctx, AV_LOG_ERROR, "error in decoupling channels\n");
597
                    return -1;
598
                }
592
                get_transform_coeffs_ch(s, CPL_CH, &m);
599 593
                uncouple_channels(s);
600 594
                got_cplchan = 1;
601 595
            }
......
611 605
    /* if any channel doesn't use dithering, zero appropriate coefficients */
612 606
    if(!s->dither_all)
613 607
        remove_dithering(s);
614

  
615
    return 0;
616 608
}
617 609

  
618 610
/**
......
1058 1050

  
1059 1051
    /* unpack the transform coefficients
1060 1052
       this also uncouples channels if coupling is in use. */
1061
    if (get_transform_coeffs(s)) {
1062
        av_log(s->avctx, AV_LOG_ERROR, "Error in routine get_transform_coeffs\n");
1063
        return -1;
1064
    }
1053
    get_transform_coeffs(s);
1065 1054

  
1066 1055
    /* recover coefficients if rematrixing is in use */
1067 1056
    if(s->channel_mode == AC3_CHMODE_STEREO)

Also available in: Unified diff