diff options
author | Hector Martin <marcan@marcan.st> | 2016-09-20 01:30:55 +0900 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-19 19:01:52 +0200 |
commit | 297f9f1bec3c0e3eca6fbfdd8a346b6c1a5b533e (patch) | |
tree | 86dcefeeacb229f874c7065686e3026612474266 /audio | |
parent | f504661852dbd7b8ff28013ffed069de75de1826 (diff) | |
download | mpv-297f9f1bec3c0e3eca6fbfdd8a346b6c1a5b533e.tar.bz2 mpv-297f9f1bec3c0e3eca6fbfdd8a346b6c1a5b533e.tar.xz |
af_pan: fix typo
This was in the parser code all along. As far as I can tell, *cp was
intended. There is no need to check cp for NULL (nor does it make any
sense to do so every time around the loop) for AF_CONTROL_COMMAND.
However, s->matrixstr can be NULL, so checking for that separately is in
order.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_pan.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/filter/af_pan.c b/audio/filter/af_pan.c index c27f4bd07c..de2adf790c 100644 --- a/audio/filter/af_pan.c +++ b/audio/filter/af_pan.c @@ -47,7 +47,7 @@ static void parse_matrix(struct af_instance *af, const char *cp) { af_pan_t *s = af->priv; int j = 0, k = 0, n; - while (cp && k < AF_NCH) { + while (*cp && k < AF_NCH) { sscanf(cp, "%f%n" , &s->level[j][k], &n); MP_VERBOSE(af, "Pan level from channel %i to" " channel %i = %f\n", k, j, s->level[j][k]); @@ -186,7 +186,8 @@ static int af_open(struct af_instance *af) return AF_ERROR; // Read pan values - parse_matrix(af, s->matrixstr); + if (s->matrixstr) + parse_matrix(af, s->matrixstr); return AF_OK; } |