summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/play.c11
-rw-r--r--apps/play.h2
-rw-r--r--apps/tree.c2
3 files changed, 8 insertions, 7 deletions
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 @@
38 38
39#define LINE_Y 1 /* initial line */ 39#define LINE_Y 1 /* initial line */
40 40
41void playtune(char *dir, char *file) 41void playtune(char *filename)
42{ 42{
43 static char mfile[256]; 43 static char mfile[256];
44 char buffer[256];
45 mp3entry mp3; 44 mp3entry mp3;
46 bool good=1; 45 bool good=1;
46#ifdef HAVE_LCD_BITMAP
47 char buffer[256];
48#endif
47 49
48 snprintf(buffer, sizeof(buffer), "%s/%s", dir, file); 50 if(mp3info(&mp3, filename)) {
49 if(mp3info(&mp3, buffer)) {
50 DEBUGF("id3 failure!"); 51 DEBUGF("id3 failure!");
51 good=0; 52 good=0;
52 } 53 }
@@ -84,7 +85,7 @@ void playtune(char *dir, char *file)
84 lcd_update(); 85 lcd_update();
85#endif 86#endif
86 87
87 snprintf(mfile, sizeof(mfile), "%s/%s", dir, file); 88 strncpy(mfile, filename, 256);
88 mpeg_play(mfile); 89 mpeg_play(mfile);
89 90
90 while(1) { 91 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 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20void playtune(char *dir, char *file); 20void 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)
310 else { 310 else {
311 311
312 playing = 1; 312 playing = 1;
313 playtune(currdir, dircacheptr[dircursor+start]->name); 313 playtune(buf);
314 playing = 0; 314 playing = 0;
315#ifdef HAVE_LCD_BITMAP 315#ifdef HAVE_LCD_BITMAP
316 lcd_setmargins(0, MARGIN_Y); 316 lcd_setmargins(0, MARGIN_Y);