From 58322542899a4f5de348566e1a65e514b8e5ff66 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Wed, 13 Oct 2010 12:13:59 +0000 Subject: fix sorting of track list when tracks with track number and tracks without track number are in the same list. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28267 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/pictureflow/pictureflow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index db4621eb24..9fb2bd4a76 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -848,20 +848,20 @@ void create_track_index(const int slide_index) int len = 0, fn_idx = 0; avail -= sizeof(struct track_data); - track_num = rb->tagcache_get_numeric(&tcs, tag_tracknumber) - 1; + track_num = rb->tagcache_get_numeric(&tcs, tag_tracknumber); disc_num = rb->tagcache_get_numeric(&tcs, tag_discnumber); if (disc_num < 0) disc_num = 0; retry: - if (track_num >= 0) + if (track_num > 0) { if (disc_num) fn_idx = 1 + rb->snprintf(track_names + string_index , avail, - "%d.%02d: %s", disc_num, track_num + 1, tcs.result); + "%d.%02d: %s", disc_num, track_num, tcs.result); else fn_idx = 1 + rb->snprintf(track_names + string_index , avail, - "%d: %s", track_num + 1, tcs.result); + "%d: %s", track_num, tcs.result); } else { @@ -910,7 +910,7 @@ retry: avail -= len; tracks--; - tracks->sort = ((disc_num - 1) << 24) + (track_num << 14) + track_count; + tracks->sort = (disc_num << 24) + (track_num << 14) + track_count; tracks->name_idx = string_index; tracks->seek = tcs.result_seek; #if PF_PLAYBACK_CAPABLE -- cgit v1.2.3