summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-10 13:51:13 +0200
committerwm4 <wm4@nowhere>2015-04-10 13:51:13 +0200
commit77869e5914d306d49d605ce0734b2a6145d02089 (patch)
treeca73a4c130339e8ff710e6fa870bd580c3c316dd
parent46eb04f3c26a14a738ae1c09f341f322cae4371d (diff)
downloadmpv-77869e5914d306d49d605ce0734b2a6145d02089.tar.bz2
mpv-77869e5914d306d49d605ce0734b2a6145d02089.tar.xz
ao_coreaudio: fix inverted condition
And also use the correct type for the printf call below.
-rw-r--r--audio/out/ao_coreaudio_utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c
index 8485011722..d606587866 100644
--- a/audio/out/ao_coreaudio_utils.c
+++ b/audio/out/ao_coreaudio_utils.c
@@ -141,16 +141,17 @@ char *fourcc_repr(void *talloc_ctx, uint32_t code)
};
bool valid_fourcc = true;
- for (int i = 0; i < 4; i++)
- if (fcc[i] >= 32 && fcc[i] < 128)
+ for (int i = 0; i < 4; i++) {
+ if (fcc[i] < 32 || fcc[i] >= 128)
valid_fourcc = false;
+ }
char *repr;
if (valid_fourcc)
repr = talloc_asprintf(talloc_ctx, "'%c%c%c%c'",
fcc[0], fcc[1], fcc[2], fcc[3]);
else
- repr = talloc_asprintf(NULL, "%d", code);
+ repr = talloc_asprintf(NULL, "%u", (unsigned int)code);
return repr;
}