aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_music.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-02 16:42:53 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-02 16:42:53 +0100
commit7a1f24cea4b042ced216a1aabb66d6d531c1bf65 (patch)
tree56f90e24eb67cead445710bec601a88805026943 /src/ft_music.c
parentYES (diff)
download42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.gz
42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.bz2
42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.xz
42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.zst
42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.zip
Music no leak
Diffstat (limited to 'src/ft_music.c')
-rw-r--r--src/ft_music.c17
1 files changed, 2 insertions, 15 deletions
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);
}