diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2024-04-09 18:02:34 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2024-04-11 14:01:27 +0200 |
commit | 05b070b0b89e04a0287d35fd68f192fe52c31abf (patch) | |
tree | c9ddb7d3292cd31682ebce74d1af16ee9c6ca9d4 /apps/playlist_viewer.c | |
parent | b57536db8dd08d7dc17a6aa3042755408a6a5464 (diff) | |
download | rockbox-05b070b0b89e04a0287d35fd68f192fe52c31abf.tar.gz rockbox-05b070b0b89e04a0287d35fd68f192fe52c31abf.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
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r-- | apps/playlist_viewer.c | 19 |
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 | |||
515 | struct mp3entry id3; | 515 | struct mp3entry id3; |
516 | bool id3_retrieval_successful = false; | 516 | bool id3_retrieval_successful = false; |
517 | 517 | ||
518 | int fd = open(current_track->name, O_RDONLY); | 518 | if (!viewer.playlist && |
519 | if (fd >= 0) | 519 | (playlist_get_resume_info(&viewer.current_playing_track) == current_track->index)) |
520 | { | 520 | { |
521 | if (get_metadata(&id3, fd, current_track->name)) | 521 | copy_mp3entry(&id3, audio_current_track()); /* retrieve id3 from RAM */ |
522 | id3_retrieval_successful = true; | 522 | id3_retrieval_successful = true; |
523 | close(fd); | 523 | } |
524 | else | ||
525 | { | ||
526 | int fd = open(current_track->name, O_RDONLY); | ||
527 | if (fd >= 0) | ||
528 | { | ||
529 | if (get_metadata(&id3, fd, current_track->name)) | ||
530 | id3_retrieval_successful = true; | ||
531 | close(fd); | ||
532 | } | ||
524 | } | 533 | } |
525 | 534 | ||
526 | return id3_retrieval_successful && | 535 | return id3_retrieval_successful && |