- commit
- 99463eb6bbeb26c8efb2cdd92be61cca3e854dc2
- parent
- 8af26cee8be29115d05c7deff1edf0aa77350281
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-12-18 13:19
create_context()
Diffstat
| M | beat.c | 13 | ++++++++----- |
1 files changed, 8 insertions, 5 deletions
diff --git a/beat.c b/beat.c
@@ -18,6 +18,12 @@ int buf_cur; 18 18 float factor; 19 19 struct context *ctx; 20 20 -1 21 struct context *create_context(void) { -1 22 struct context *c = (struct context *)malloc(sizeof(struct context)); -1 23 memset(c->buf, 0, BUFSIZE * sizeof(float)); -1 24 return c; -1 25 } -1 26 21 27 void add_file_at_beat(const char *path, int beat) { 22 28 int ibs = 1024; 23 29 int pos = beat * frames_per_beat; @@ -72,11 +78,8 @@ int main(int argc, char **argv) { 72 78 73 79 buf_cur = 0; 74 8075 -1 ctx = (struct context *)malloc(sizeof(struct context));76 -1 memset(ctx->buf, 0, BUFSIZE * sizeof(float));77 -178 -1 ctx->next = (struct context *)malloc(sizeof(struct context));79 -1 memset(ctx->next->buf, 0, BUFSIZE * sizeof(float));-1 81 ctx = create_context(); -1 82 ctx->next = create_context(); 80 83 ctx->next->next = ctx; 81 84 82 85 SF_INFO sfinfo;