[FFmpeg-cvslog] avfilter/af_channelmap: add support for unknown input channel layouts

Marton Balint git at videolan.org
Sat Dec 10 13:10:09 EET 2016


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Dec  3 20:02:47 2016 +0100| [01a19f77caa42a7be5cd40c4b020c550e7065fe0] | committer: Marton Balint

avfilter/af_channelmap: add support for unknown input channel layouts

Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01a19f77caa42a7be5cd40c4b020c550e7065fe0
---

 libavfilter/af_channelmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index dcae2a2..cdd8a58 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -291,7 +291,7 @@ static int channelmap_query_formats(AVFilterContext *ctx)
     AVFilterChannelLayouts *channel_layouts = NULL;
     int ret;
 
-    layouts = ff_all_channel_layouts();
+    layouts = ff_all_channel_counts();
     if (!layouts) {
         ret = AVERROR(ENOMEM);
         goto fail;
@@ -316,7 +316,7 @@ static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf)
     AVFilterContext  *ctx = inlink->dst;
     AVFilterLink *outlink = ctx->outputs[0];
     const ChannelMapContext *s = ctx->priv;
-    const int nch_in = av_get_channel_layout_nb_channels(inlink->channel_layout);
+    const int nch_in = inlink->channels;
     const int nch_out = s->nch;
     int ch;
     uint8_t *source_planes[MAX_CH];
@@ -363,7 +363,7 @@ static int channelmap_config_input(AVFilterLink *inlink)
 {
     AVFilterContext *ctx = inlink->dst;
     ChannelMapContext *s = ctx->priv;
-    int nb_channels = av_get_channel_layout_nb_channels(inlink->channel_layout);
+    int nb_channels = inlink->channels;
     int i, err = 0;
     const char *channel_name;
     char layout_name[256];
@@ -378,7 +378,7 @@ static int channelmap_config_input(AVFilterLink *inlink)
 
         if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) {
             av_get_channel_layout_string(layout_name, sizeof(layout_name),
-                                         0, inlink->channel_layout);
+                                         nb_channels, inlink->channel_layout);
             if (m->in_channel) {
                 channel_name = av_get_channel_name(m->in_channel);
                 av_log(ctx, AV_LOG_ERROR,



More information about the ffmpeg-cvslog mailing list