Revision 65bec42e

View differences:

libavcodec/aac_ac3_parser.c
81 81
    if (avctx->codec_id != CODEC_ID_AAC) {
82 82
        avctx->sample_rate = s->sample_rate;
83 83

  
84
    /* allow downmixing to stereo (or mono for AC-3) */
85
    if(avctx->request_channels > 0 &&
86
            avctx->request_channels < s->channels &&
87
            (avctx->request_channels <= 2 ||
88
            (avctx->request_channels == 1 &&
89
            (avctx->codec_id == CODEC_ID_AC3 ||
90
             avctx->codec_id == CODEC_ID_EAC3)))) {
91
        avctx->channels = avctx->request_channels;
92
    } else {
93
        avctx->channels = s->channels;
94
        avctx->channel_layout = s->channel_layout;
95
    }
96
    avctx->frame_size = s->samples;
84
        /* allow downmixing to stereo (or mono for AC-3) */
85
        if(avctx->request_channels > 0 &&
86
                avctx->request_channels < s->channels &&
87
                (avctx->request_channels <= 2 ||
88
                (avctx->request_channels == 1 &&
89
                (avctx->codec_id == CODEC_ID_AC3 ||
90
                 avctx->codec_id == CODEC_ID_EAC3)))) {
91
            avctx->channels = avctx->request_channels;
92
        } else {
93
            avctx->channels = s->channels;
94
            avctx->channel_layout = s->channel_layout;
95
        }
96
        avctx->frame_size = s->samples;
97 97
    }
98 98

  
99 99
    avctx->bit_rate = s->bit_rate;

Also available in: Unified diff