case AVMEDIA_TYPE_AUDIO:
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)) {
+ av_log(NULL, AV_LOG_ERROR, "libavfilter does not support this channel layout\n");
+ return AVERROR(EINVAL);
+ }
break;
default:
return AVERROR(EINVAL);
frame->format);
if (!picref)
return NULL;
- avfilter_copy_frame_props(picref, frame);
+ if (avfilter_copy_frame_props(picref, frame) < 0) {
+ picref->buf->data[0] = NULL;
+ avfilter_unref_bufferp(&picref);
+ }
return picref;
}
av_frame_get_channel_layout(frame));
if (!samplesref)
return NULL;
- avfilter_copy_frame_props(samplesref, frame);
+ if (avfilter_copy_frame_props(samplesref, frame) < 0) {
+ samplesref->buf->data[0] = NULL;
+ avfilter_unref_bufferp(&samplesref);
+ }
return samplesref;
}
dst->nb_samples = src->audio->nb_samples;
av_frame_set_sample_rate (dst, src->audio->sample_rate);
av_frame_set_channel_layout(dst, src->audio->channel_layout);
+ av_frame_set_channels (dst, src->audio->channels);
break;
default:
return AVERROR(EINVAL);