aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2020-04-22 08:38:31 -0400
committerTaylor Holberton <taylorcholberton@gmail.com>2020-04-22 08:38:31 -0400
commit6b105acd80fa144d3b68aa7f5524da202df0d159 (patch)
treedf879c2030962de65ecb4cd8a8b1695b348108a6 /utils
parent67cca676121ec99bd31caf9e70e888280b9399c8 (diff)
Removed whitespace
Diffstat (limited to 'utils')
-rw-r--r--utils/tinyplay.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/utils/tinyplay.c b/utils/tinyplay.c
index e3c7b0d..dde3a21 100644
--- a/utils/tinyplay.c
+++ b/utils/tinyplay.c
@@ -188,10 +188,11 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd)
return -1;
}
if (strcmp(cmd->filename, "-") == 0) {
- ctx->file = stdin;
+ ctx->file = stdin;
} else {
- ctx->file = fopen(cmd->filename, "rb");
- }
+ ctx->file = fopen(cmd->filename, "rb");
+ }
+
if (ctx->file == NULL) {
fprintf(stderr, "failed to open '%s'\n", cmd->filename);
return -1;
@@ -209,7 +210,7 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd)
fclose(ctx->file);
return -1;
}
- unsigned int more_chunks = 1;
+ unsigned int more_chunks = 1;
do {
if (fread(&ctx->chunk_header, sizeof(ctx->chunk_header), 1, ctx->file) != 1){
fprintf(stderr, "error: '%s' does not contain a data chunk\n", cmd->filename);
@@ -412,8 +413,8 @@ int play_sample(struct ctx *ctx)
do {
num_read = fread(buffer, 1, size, ctx->file);
if (num_read > 0) {
- if (pcm_writei(ctx->pcm, buffer,
- pcm_bytes_to_frames(ctx->pcm, num_read)) < 0) {
+ if (pcm_writei(ctx->pcm, buffer,
+ pcm_bytes_to_frames(ctx->pcm, num_read)) < 0) {
fprintf(stderr, "error playing sample\n");
break;
}