summaryrefslogtreecommitdiff
path: root/libavfilter/avcodec.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-07-30 16:00:05 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-11-13 12:15:27 +0100
commit794566520018d65ae0678b3928fe78d5ed7a8004 (patch)
tree0879db4474c575f029c6f92f4cb9136aaf1888d5 /libavfilter/avcodec.c
parent9d2a7c04812ae6f3db2e58570242a15ff25a335a (diff)
lavfi: store and propagate number of channels information in audio buffer properties
The channels field is required since the channel layout is not always available.
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r--libavfilter/avcodec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c
index c9c8f3c1c1..5ace9d9686 100644
--- a/libavfilter/avcodec.c
+++ b/libavfilter/avcodec.c
@@ -60,6 +60,7 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
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(0, AV_LOG_ERROR, "libavfilter does not support this channel layout\n");
return AVERROR(EINVAL);
@@ -161,6 +162,7 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
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);