diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-09-20 21:28:34 +0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-10-08 00:45:50 +0400 |
commit | 7b556be6735371d1040c7076547b8198d9fadd34 (patch) | |
tree | 5a4766eb875ed6ec77a73126c4a7bf5de3e73e1b /libavfilter | |
parent | 37f701f1c3967e7e2e3e6d67b4280bdcf13fdee1 (diff) |
af_resample: avoid conversion of identical sample formats for 1 channel
When there is only 1 channel, the planar and interleaved formats of the same
data type should be treated as identical.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_resample.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c index c51f9d243b..58a9b2a99e 100644 --- a/libavfilter/af_resample.c +++ b/libavfilter/af_resample.c @@ -93,7 +93,11 @@ static int config_output(AVFilterLink *outlink) if (inlink->channel_layout == outlink->channel_layout && inlink->sample_rate == outlink->sample_rate && - inlink->format == outlink->format) + (inlink->format == outlink->format || + (av_get_channel_layout_nb_channels(inlink->channel_layout) == 1 && + av_get_channel_layout_nb_channels(outlink->channel_layout) == 1 && + av_get_planar_sample_fmt(inlink->format) == + av_get_planar_sample_fmt(outlink->format)))) return 0; if (!(s->avr = avresample_alloc_context())) @@ -226,6 +230,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) fail: avfilter_unref_buffer(buf); } else { + buf->format = outlink->format; ret = ff_filter_samples(outlink, buf); s->got_output = 1; } |