diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-02-20 21:43:16 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-02-20 23:36:03 +0100 |
commit | eb9ba527e71fe11f425ecfaf935955a5accc716a (patch) | |
tree | c937d6a685523f2f633a65731d9ec78b90f8e61d /libavfilter | |
parent | 6a3f1726af914183ee9b735b6b28e79f0383058d (diff) | |
download | ffmpeg-eb9ba527e71fe11f425ecfaf935955a5accc716a.tar.gz |
af_pan: remove the indirect function call.
libswresample is used in all cases.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_pan.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index bb08e269e3..a9609df630 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -48,11 +48,6 @@ typedef struct PanContext { int nb_output_channels; int pure_gains; - void (*filter_samples)(struct PanContext*, - AVFilterBufferRef*, - AVFilterBufferRef*, - int); - /* channel mapping specific */ int channel_map[SWR_CH_MAX]; struct SwrContext *swr; @@ -332,14 +327,6 @@ static int config_props(AVFilterLink *link) return 0; } -static void filter_samples_channel_mapping(PanContext *pan, - AVFilterBufferRef *outsamples, - AVFilterBufferRef *insamples, - int n) -{ - swr_convert(pan->swr, outsamples->data, n, (void *)insamples->data, n); -} - static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) { int n = insamples->audio->nb_samples; @@ -347,8 +334,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) AVFilterBufferRef *outsamples = avfilter_get_audio_buffer(outlink, AV_PERM_WRITE, n); PanContext *pan = inlink->dst->priv; - pan->filter_samples(pan, outsamples, insamples, n); - + swr_convert(pan->swr, outsamples->data, n, (void *)insamples->data, n); avfilter_copy_buffer_ref_props(outsamples, insamples); outsamples->audio->channel_layout = outlink->channel_layout; outsamples->audio->planar = outlink->planar; @@ -368,7 +354,6 @@ static int query_formats(AVFilterContext *ctx) /* libswr supports any sample and packing formats */ avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO)); avfilter_set_common_packing_formats(ctx, avfilter_make_all_packing_formats()); - pan->filter_samples = filter_samples_channel_mapping; // inlink supports any channel layout formats = avfilter_make_all_channel_layouts(); |