Revision 7d3829a8 libavcodec/mpc.c

View differences:

libavcodec/mpc.c
42 42
/**
43 43
 * Process decoded Musepack data and produce PCM
44 44
 */
45
static void mpc_synth(MPCContext *c, int16_t *out)
45
static void mpc_synth(MPCContext *c, int16_t *out, int channels)
46 46
{
47 47
    int dither_state = 0;
48 48
    int i, ch;
49 49
    OUT_INT samples[MPA_MAX_CHANNELS * MPA_FRAME_SIZE], *samples_ptr;
50 50

  
51
    for(ch = 0;  ch < 2; ch++){
51
    for(ch = 0;  ch < channels; ch++){
52 52
        samples_ptr = samples + ch;
53 53
        for(i = 0; i < SAMPLES_PER_BAND; i++) {
54 54
            ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
55 55
                                ff_mpa_synth_window, &dither_state,
56
                                samples_ptr, 2,
56
                                samples_ptr, channels,
57 57
                                c->sb_samples[ch][i]);
58
            samples_ptr += 64;
58
            samples_ptr += 32 * channels;
59 59
        }
60 60
    }
61
    for(i = 0; i < MPC_FRAME_SIZE*2; i++)
61
    for(i = 0; i < MPC_FRAME_SIZE*channels; i++)
62 62
        *out++=samples[i];
63 63
}
64 64

  
65
void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data)
65
void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data, int channels)
66 66
{
67 67
    int i, j, ch;
68 68
    Band *bands = c->bands;
......
98 98
        }
99 99
    }
100 100

  
101
    mpc_synth(c, data);
101
    mpc_synth(c, data, channels);
102 102
}

Also available in: Unified diff