Revision 7c8c55ff

View differences:

libavcodec/libvorbis.c
96 96
        vorbis_encode_ctl(vi, OV_ECTL_IBLOCK_SET, &context->iblock);
97 97
    }
98 98

  
99
    if (avccontext->channels == 3 &&
100
            avccontext->channel_layout != (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER) ||
101
        avccontext->channels == 4 &&
102
            avccontext->channel_layout != AV_CH_LAYOUT_2_2 &&
103
            avccontext->channel_layout != AV_CH_LAYOUT_QUAD ||
104
        avccontext->channels == 5 &&
105
            avccontext->channel_layout != AV_CH_LAYOUT_5POINT0 &&
106
            avccontext->channel_layout != AV_CH_LAYOUT_5POINT0_BACK ||
107
        avccontext->channels == 6 &&
108
            avccontext->channel_layout != AV_CH_LAYOUT_5POINT1 &&
109
            avccontext->channel_layout != AV_CH_LAYOUT_5POINT1_BACK ||
110
        avccontext->channels == 7 &&
111
            avccontext->channel_layout != (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER) ||
112
        avccontext->channels == 8 &&
113
            avccontext->channel_layout != AV_CH_LAYOUT_7POINT1) {
114
        if (avccontext->channel_layout) {
115
            char name[32];
116
            av_get_channel_layout_string(name, sizeof(name), avccontext->channels,
117
                                         avccontext->channel_layout);
118
            av_log(avccontext, AV_LOG_ERROR, "%s not supported by Vorbis: "
119
                                             "output stream will have incorrect "
120
                                             "channel layout.\n", name);
121
        } else {
122
            av_log(avccontext, AV_LOG_WARNING, "No channel layout specified. The encoder "
123
                                               "will use Vorbis channel layout for "
124
                                               "%d channels.\n", avccontext->channels);
125
        }
126
    }
127

  
99 128
    return vorbis_encode_setup_init(vi);
100 129
}
101 130

  

Also available in: Unified diff