mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-14 19:10:09 +01:00
af_pan: avoid spaces before % to avoid possible issues with MSVC
Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -55,14 +55,23 @@ typedef struct PanContext {
|
|||||||
struct SwrContext *swr;
|
struct SwrContext *swr;
|
||||||
} PanContext;
|
} 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)
|
static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
|
||||||
{
|
{
|
||||||
char buf[8];
|
char buf[8];
|
||||||
int len, i, channel_id = 0;
|
int len, i, channel_id = 0;
|
||||||
int64_t layout, layout0;
|
int64_t layout, layout0;
|
||||||
|
|
||||||
|
skip_spaces(arg);
|
||||||
/* try to parse a channel name, e.g. "FL" */
|
/* 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);
|
layout0 = layout = av_get_channel_layout(buf);
|
||||||
/* channel_id <- first set bit in layout */
|
/* channel_id <- first set bit in layout */
|
||||||
for (i = 32; i > 0; i >>= 1) {
|
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);
|
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)
|
static av_cold int init(AVFilterContext *ctx, const char *args0)
|
||||||
{
|
{
|
||||||
PanContext *const pan = ctx->priv;
|
PanContext *const pan = ctx->priv;
|
||||||
|
|||||||
Reference in New Issue
Block a user