From 53b5227270ff21c0f4c8aeb8c33a9f4dcbe20600 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 25 Aug 2013 18:23:40 +0200 Subject: audio: make internal audio format 0 an invalid format Having to use -1 for that is generally quite annoying. Audio formats are created from bitmasks, and it can't be excluded that 0 is not a valid format. Fix this by adjusting AF_FORMAT_I so that it is never 0. Along with AF_FORMAT_F and the special formats, all valid formats are covered and guaranteed to be non-0. It's possible that this commit will cause some regressions, as the check for invalid audio formats changes a bit. --- audio/filter/af_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/filter') diff --git a/audio/filter/af_format.c b/audio/filter/af_format.c index 616bc9e494..6166ee3ff0 100644 --- a/audio/filter/af_format.c +++ b/audio/filter/af_format.c @@ -150,7 +150,7 @@ static int control(struct af_instance* af, int cmd, void* arg) } case AF_CONTROL_COMMAND_LINE:{ int format = af_str2fmt_short(bstr0(arg)); - if (format == -1) { + if (!format) { mp_msg(MSGT_AFILTER, MSGL_ERR, "[format] %s is not a valid format\n", (char *)arg); return AF_ERROR; } -- cgit v1.2.3