summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 016126bffb..fa35ed994f 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -56,6 +56,10 @@
56#include "bmp.h" 56#include "bmp.h"
57#endif 57#endif
58 58
59#ifdef HAVE_ALBUMART
60#include "playback.h"
61#endif
62
59#include "backdrop.h" 63#include "backdrop.h"
60 64
61#define WPS_ERROR_INVALID_PARAM -1 65#define WPS_ERROR_INVALID_PARAM -1
@@ -985,6 +989,8 @@ static int parse_albumart_load(const char *wps_bufptr,
985{ 989{
986 const char *_pos, *newline; 990 const char *_pos, *newline;
987 bool parsing; 991 bool parsing;
992 struct dim dimensions;
993 int albumart_slot;
988 struct skin_albumart *aa = skin_buffer_alloc(sizeof(struct skin_albumart)); 994 struct skin_albumart *aa = skin_buffer_alloc(sizeof(struct skin_albumart));
989 (void)token; /* silence warning */ 995 (void)token; /* silence warning */
990 if (!aa) 996 if (!aa)
@@ -1125,6 +1131,16 @@ static int parse_albumart_load(const char *wps_bufptr,
1125 aa->draw = false; 1131 aa->draw = false;
1126 wps_data->albumart = aa; 1132 wps_data->albumart = aa;
1127 1133
1134 dimensions.width = aa->width;
1135 dimensions.height = aa->height;
1136
1137 albumart_slot = playback_claim_aa_slot(&dimensions);
1138
1139 if (albumart_slot < 0) /* didn't get a slot ? */
1140 return skip_end_of_line(wps_bufptr);
1141 else
1142 wps_data->playback_aa_slot = albumart_slot;
1143
1128 /* Skip the rest of the line */ 1144 /* Skip the rest of the line */
1129 return skip_end_of_line(wps_bufptr); 1145 return skip_end_of_line(wps_bufptr);
1130} 1146}
@@ -1601,6 +1617,11 @@ void skin_data_reset(struct wps_data *wps_data)
1601 wps_data->strings = NULL; 1617 wps_data->strings = NULL;
1602#ifdef HAVE_ALBUMART 1618#ifdef HAVE_ALBUMART
1603 wps_data->albumart = NULL; 1619 wps_data->albumart = NULL;
1620 if (wps_data->playback_aa_slot >= 0)
1621 {
1622 playback_release_aa_slot(wps_data->playback_aa_slot);
1623 wps_data->playback_aa_slot = -1;
1624 }
1604#endif 1625#endif
1605 wps_data->tokens = NULL; 1626 wps_data->tokens = NULL;
1606 wps_data->num_tokens = 0; 1627 wps_data->num_tokens = 0;