From 7a1f24cea4b042ced216a1aabb66d6d531c1bf65 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 2 Mar 2020 16:42:53 +0100 Subject: Music no leak --- src/ft_music.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/ft_music.c') diff --git a/src/ft_music.c b/src/ft_music.c index a4d588a..8006928 100644 --- a/src/ft_music.c +++ b/src/ft_music.c @@ -19,24 +19,11 @@ void *ft_music_thread(void *vargp) { - char *cmd; - uint8_t len; t_cub *cl; cl = (t_cub *)vargp; - len = ft_strlen(cl->mlist->music_path); - if (FT_OS == 2) - len += 22; - else - len += 18; - if (!(cmd = (char *)malloc((len + 1) * sizeof(char)))) - return (NULL); - if (FT_OS == 2) - ft_sprintf(cmd, "aplay -f cd -t wav -q %s", cl->mlist->music_path); - else {} - ft_printf("\n\n========= QWEQWE =========\n%s\n", cmd); - system(cmd); - ft_memdel((void**)&cmd); + ft_printf("%s\n", cl->mlist->music_cmd); + system(cl->mlist->music_cmd); return (NULL); } -- cgit v1.2.3