diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-12 10:45:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-12 10:52:55 +0200 |
commit | 80116b6e675528203923e18e0c10c90ffa77c013 (patch) | |
tree | 5b1d672fab21b4e12e349c6c51acf9a0d64a7da7 /libavfilter/af_pan.c | |
parent | 3c821e7550866129ad19d4bba0f84dc4648ceb5a (diff) | |
download | ffmpeg-80116b6e675528203923e18e0c10c90ffa77c013.tar.gz |
af_pan: avoid spaces before % to avoid possible issues with MSVC
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_pan.c')
-rw-r--r-- | libavfilter/af_pan.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index 338cc6ea00..4aa5fd9b75 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -55,14 +55,23 @@ typedef struct PanContext { struct SwrContext *swr; } PanContext; +static void skip_spaces(char **arg) +{ + int len = 0; + + sscanf(*arg, " %n", &len); + *arg += len; +} + static int parse_channel_name(char **arg, int *rchannel, int *rnamed) { char buf[8]; int len, i, channel_id = 0; int64_t layout, layout0; + skip_spaces(arg); /* try to parse a channel name, e.g. "FL" */ - if (sscanf(*arg, " %7[A-Z] %n", buf, &len)) { + if (sscanf(*arg, "%7[A-Z]%n", buf, &len)) { layout0 = layout = av_get_channel_layout(buf); /* channel_id <- first set bit in layout */ for (i = 32; i > 0; i >>= 1) { @@ -90,14 +99,6 @@ static int parse_channel_name(char **arg, int *rchannel, int *rnamed) return AVERROR(EINVAL); } -static void skip_spaces(char **arg) -{ - int len = 0; - - sscanf(*arg, " %n", &len); - *arg += len; -} - static av_cold int init(AVFilterContext *ctx, const char *args0) { PanContext *const pan = ctx->priv; |