summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2024-04-09 18:02:34 +0200
committerChristian Soffke <christian.soffke@gmail.com>2024-04-11 14:01:27 +0200
commit05b070b0b89e04a0287d35fd68f192fe52c31abf (patch)
treec9ddb7d3292cd31682ebce74d1af16ee9c6ca9d4
parentb57536db8dd08d7dc17a6aa3042755408a6a5464 (diff)
downloadrockbox-05b070b0b8.tar.gz
rockbox-05b070b0b8.zip
playlist viewer: get Info for playing track from RAM
No need to hit the disk to retrieve metadata for the currently playing track Change-Id: I944910adfb750d3f8fb52b8c057e98d58700cf17
-rw-r--r--apps/playlist_viewer.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 1d8b1b1b03..61a765ca9e 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -515,12 +515,21 @@ static enum pv_onplay_result show_track_info(const struct playlist_entry *curren
struct mp3entry id3;
bool id3_retrieval_successful = false;
- int fd = open(current_track->name, O_RDONLY);
- if (fd >= 0)
+ if (!viewer.playlist &&
+ (playlist_get_resume_info(&viewer.current_playing_track) == current_track->index))
{
- if (get_metadata(&id3, fd, current_track->name))
- id3_retrieval_successful = true;
- close(fd);
+ copy_mp3entry(&id3, audio_current_track()); /* retrieve id3 from RAM */
+ id3_retrieval_successful = true;
+ }
+ else
+ {
+ int fd = open(current_track->name, O_RDONLY);
+ if (fd >= 0)
+ {
+ if (get_metadata(&id3, fd, current_track->name))
+ id3_retrieval_successful = true;
+ close(fd);
+ }
}
return id3_retrieval_successful &&