forked from len0rd/rockbox
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
This commit is contained in:
parent
b57536db8d
commit
05b070b0b8
1 changed files with 14 additions and 5 deletions
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue