diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-12-02 16:31:15 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-12-20 13:03:41 +0100 |
commit | 238edd2fe33da8281b3774196c3de503ea64b745 (patch) | |
tree | 9f71652f61febabf3bcf35e0cb87f5a2df7bbabd /libavfilter/audio.c | |
parent | a9275b4f6938ef5954a7c3d5b86787eac600611c (diff) | |
download | ffmpeg-238edd2fe33da8281b3774196c3de503ea64b745.tar.gz |
lavfi: add a channels field to AVFilterLink.
Also: fix af_pan and af_aresample, that forgot to update
audio->channels.
Diffstat (limited to 'libavfilter/audio.c')
-rw-r--r-- | libavfilter/audio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/audio.c b/libavfilter/audio.c index f157e877cd..565f2e264c 100644 --- a/libavfilter/audio.c +++ b/libavfilter/audio.c @@ -93,6 +93,7 @@ AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data, enum AVSampleFormat sample_fmt, uint64_t channel_layout) { + int channels = av_get_channel_layout_nb_channels(channel_layout); int planes; AVFilterBuffer *samples = av_mallocz(sizeof(*samples)); AVFilterBufferRef *samplesref = av_mallocz(sizeof(*samplesref)); @@ -107,9 +108,9 @@ AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data, samplesref->audio->nb_samples = nb_samples; samplesref->audio->channel_layout = channel_layout; + samplesref->audio->channels = channels; - planes = av_sample_fmt_is_planar(sample_fmt) ? - av_get_channel_layout_nb_channels(channel_layout) : 1; + planes = av_sample_fmt_is_planar(sample_fmt) ? channels : 1; /* make sure the buffer gets read permission or it's useless for output */ samplesref->perms = perms | AV_PERM_READ; @@ -225,6 +226,7 @@ int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) int ret = 0; av_assert1(samplesref->format == link->format); + av_assert1(samplesref->audio->channels == link->channels); av_assert1(samplesref->audio->channel_layout == link->channel_layout); av_assert1(samplesref->audio->sample_rate == link->sample_rate); |