diff --git a/apps/play.c b/apps/play.c index aae7895d87..5949372e04 100644 --- a/apps/play.c +++ b/apps/play.c @@ -38,15 +38,16 @@ #define LINE_Y 1 /* initial line */ -void playtune(char *dir, char *file) +void playtune(char *filename) { static char mfile[256]; - char buffer[256]; mp3entry mp3; bool good=1; +#ifdef HAVE_LCD_BITMAP + char buffer[256]; +#endif - snprintf(buffer, sizeof(buffer), "%s/%s", dir, file); - if(mp3info(&mp3, buffer)) { + if(mp3info(&mp3, filename)) { DEBUGF("id3 failure!"); good=0; } @@ -84,7 +85,7 @@ void playtune(char *dir, char *file) lcd_update(); #endif - snprintf(mfile, sizeof(mfile), "%s/%s", dir, file); + strncpy(mfile, filename, 256); mpeg_play(mfile); while(1) { diff --git a/apps/play.h b/apps/play.h index b63df29c82..a8e68a61b6 100644 --- a/apps/play.h +++ b/apps/play.h @@ -17,4 +17,4 @@ * ****************************************************************************/ -void playtune(char *dir, char *file); +void playtune(char *filename); diff --git a/apps/tree.c b/apps/tree.c index b0c17d3a42..7bb473f28e 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -310,7 +310,7 @@ bool dirbrowse(char *root) else { playing = 1; - playtune(currdir, dircacheptr[dircursor+start]->name); + playtune(buf); playing = 0; #ifdef HAVE_LCD_BITMAP lcd_setmargins(0, MARGIN_Y);