liavfi/avcodec: allow channel layouts with fewer channels than actually available.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Nov 2012 18:26:46 +0000 (19:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Nov 2012 21:54:18 +0000 (22:54 +0100)
This fixes the regression with Ticket1726, where some audio was lost.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/avcodec.c

index 5ace9d9..30b8258 100644 (file)
@@ -61,7 +61,7 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
         dst->audio->sample_rate         = src->sample_rate;
         dst->audio->channel_layout      = src->channel_layout;
         dst->audio->channels            = src->channels;
-        if(src->channels != av_get_channel_layout_nb_channels(src->channel_layout)) {
+        if(src->channels < av_get_channel_layout_nb_channels(src->channel_layout)) {
             av_log(0, AV_LOG_ERROR, "libavfilter does not support this channel layout\n");
             return AVERROR(EINVAL);
         }