summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index ba9396ae74..4bd1ffea31 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -74,7 +74,7 @@
74static const char* get_codectype(const struct mp3entry* id3) 74static const char* get_codectype(const struct mp3entry* id3)
75{ 75{
76 if (id3 && id3->codectype < AFMT_NUM_CODECS) { 76 if (id3 && id3->codectype < AFMT_NUM_CODECS) {
77 return audio_formats[id3->codectype].label; 77 return get_codec_string(id3->codectype);
78 } else { 78 } else {
79 return NULL; 79 return NULL;
80 } 80 }
@@ -556,20 +556,29 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename)
556 pid3 = state->nid3; 556 pid3 = state->nid3;
557 else 557 else
558 { 558 {
559 static char filename_buf[MAX_PATH + 1]; 559 static struct mp3entry tempid3; /* Note: path gets passed to outside fns */
560 fname = playlist_peek(offset, filename_buf, sizeof(filename_buf)); 560 memset(&tempid3, 0, sizeof(struct mp3entry));
561 /*static char filename_buf[MAX_PATH + 1];removed g#5926 */
562 fname = playlist_peek(offset, tempid3.path, sizeof(tempid3.path));
561 *filename = (char*)fname; 563 *filename = (char*)fname;
562 static struct mp3entry tempid3; 564
563 if ( 565 if (
564#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 566#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
565 tagcache_fill_tags(&tempid3, fname) || 567 tagcache_fill_tags(&tempid3, NULL) ||
566#endif 568#endif
567 audio_peek_track(&tempid3, offset) 569 audio_peek_track(&tempid3, offset)
568 ) 570 )
569 { 571 {
570 pid3 = &tempid3; 572 pid3 = &tempid3;
571 } 573 }
574 else /* failed */
575 {
576 /* ensure *filename gets the path, audio_peek_track() cleared it */
577 fname = playlist_peek(offset, tempid3.path, sizeof(tempid3.path));
578 *filename = (char*)fname;
579 }
572 } 580 }
581
573 return pid3; 582 return pid3;
574} 583}
575 584
@@ -710,8 +719,6 @@ const char *get_token_value(struct gui_wps *gwps,
710 return NULL; 719 return NULL;
711 720
712 id3 = get_mp3entry_from_offset(token->next? 1: offset, &filename); 721 id3 = get_mp3entry_from_offset(token->next? 1: offset, &filename);
713 if (id3)
714 filename = id3->path;
715 722
716#if CONFIG_RTC 723#if CONFIG_RTC
717 struct tm* tm = NULL; 724 struct tm* tm = NULL;