[FFmpeg-cvslog] avfilter/af_sofalizer: warn if user gives unknown channel names

Paul B Mahol git at videolan.org
Wed Dec 14 23:51:49 EET 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Dec 14 22:47:38 2016 +0100| [458fbee22154bd01b2d8f93ad7ff76ac63bbc32e] | committer: Paul B Mahol

avfilter/af_sofalizer: warn if user gives unknown channel names

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/af_sofalizer.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 7558f57..400b3c7 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -373,9 +373,8 @@ error:
     return ret;
 }
 
-static int parse_channel_name(char **arg, int *rchannel)
+static int parse_channel_name(char **arg, int *rchannel, char *buf)
 {
-    char buf[8];
     int len, i, channel_id = 0;
     int64_t layout, layout0;
 
@@ -409,12 +408,15 @@ static void parse_speaker_pos(AVFilterContext *ctx, int64_t in_channel_layout)
     p = args;
 
     while ((arg = av_strtok(p, "|", &tokenizer))) {
+        char buf[8];
         float azim, elev;
         int out_ch_id;
 
         p = NULL;
-        if (parse_channel_name(&arg, &out_ch_id))
+        if (parse_channel_name(&arg, &out_ch_id, buf)) {
+            av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", buf);
             continue;
+        }
         if (sscanf(arg, "%f %f", &azim, &elev) == 2) {
             s->vspkrpos[out_ch_id].set = 1;
             s->vspkrpos[out_ch_id].azim = azim;



More information about the ffmpeg-cvslog mailing list