summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_engine.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-05-14 07:03:44 +0200
committerThomas Martitz <kugel@rockbox.org>2013-06-09 17:39:08 +0200
commit58b4e71d3244b3c433e1fd3b494d17379bf57c48 (patch)
tree69530502e78b93fd09ec3db3faa59d91b765f438 /apps/gui/skin_engine/skin_engine.c
parent280a0eb27ee0f9661c44e9230f7f59b2551b18af (diff)
downloadrockbox-58b4e71d3244b3c433e1fd3b494d17379bf57c48.tar.gz
rockbox-58b4e71d3244b3c433e1fd3b494d17379bf57c48.zip
skin_engine: Fix albumart logic on skin reloading.
This logic checks whether the skin's albumart dimensions differ from the previous skin to force rebuffering if necessary. This was broken since a while as the necessary information was reset. Change-Id: I3b9f3a819c6af202af8ad66c13742f704ce45ab1 Reviewed-on: http://gerrit.rockbox.org/476 Tested-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps/gui/skin_engine/skin_engine.c')
-rw-r--r--apps/gui/skin_engine/skin_engine.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 4c113e5c68..5253b88363 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -83,10 +83,23 @@ struct skin_stats *skin_get_stats(int number, int screen)
static void gui_skin_reset(struct gui_skin *skin)
{
+ struct wps_data *data;
+ struct skin_albumart *aa_save;
skin->failsafe_loaded = false;
skin->needs_full_update = true;
- skin->gui_wps.data = &skin->data;
- memset(skin->gui_wps.data, 0, sizeof(struct wps_data));
+ skin->gui_wps.data = data = &skin->data;
+ /* copy to temp var to protect against memset */
+ if ((aa_save = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart)))
+ {
+ short old_width, old_height;
+ old_width = aa_save->width;
+ old_height = aa_save->height;
+ memset(data, 0, sizeof(struct wps_data));
+ data->last_albumart_width = old_width;
+ data->last_albumart_height = old_height;
+ }
+ else
+ memset(data, 0, sizeof(struct wps_data));
skin->data.wps_loaded = false;
skin->data.buflib_handle = -1;
skin->data.tree = -1;