mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Restore clearing resume info for current track in playing_id3_sync
Regression introduced in 3d5dd97c
(#5426)
Without it current playlist keeps last bookmark info so next time track is played again from bookmark.
Change-Id: Ifeff43a4a2d380056ef8a389c3c72e7254db4080
This commit is contained in:
parent
d78be6716b
commit
f377ad3ce7
1 changed files with 12 additions and 11 deletions
|
@ -1255,8 +1255,7 @@ static void audio_update_and_announce_next_track(const struct mp3entry *id3_next
|
||||||
|
|
||||||
/* Bring the user current mp3entry up to date and set a new offset for the
|
/* Bring the user current mp3entry up to date and set a new offset for the
|
||||||
buffered metadata */
|
buffered metadata */
|
||||||
static void playing_id3_sync(struct track_info *user_infop,
|
static void playing_id3_sync(struct track_info *user_infop, struct audio_resume_info *resume_info)
|
||||||
unsigned long elapsed, unsigned long offset)
|
|
||||||
{
|
{
|
||||||
id3_mutex_lock();
|
id3_mutex_lock();
|
||||||
|
|
||||||
|
@ -1264,16 +1263,18 @@ static void playing_id3_sync(struct track_info *user_infop,
|
||||||
|
|
||||||
pcm_play_lock();
|
pcm_play_lock();
|
||||||
|
|
||||||
if (id3)
|
if (resume_info && id3)
|
||||||
{
|
{
|
||||||
if (elapsed != (unsigned long)-1)
|
id3->elapsed = resume_info->elapsed;
|
||||||
id3->elapsed = elapsed;
|
id3->offset = resume_info->offset;
|
||||||
|
|
||||||
if (offset != (unsigned long)-1)
|
|
||||||
id3->offset = offset;
|
|
||||||
}
|
}
|
||||||
id3_write(PLAYING_ID3, id3);
|
id3_write(PLAYING_ID3, id3);
|
||||||
|
|
||||||
|
if (!resume_info && id3)
|
||||||
|
{
|
||||||
|
id3->offset = 0;
|
||||||
|
id3->elapsed = 0;
|
||||||
|
}
|
||||||
pcm_play_unlock();
|
pcm_play_unlock();
|
||||||
|
|
||||||
id3_mutex_unlock();
|
id3_mutex_unlock();
|
||||||
|
@ -2433,7 +2434,7 @@ static void audio_on_finish_load_track(int id3_hid)
|
||||||
change otherwise */
|
change otherwise */
|
||||||
bool was_valid = valid_mp3entry(id3_get(PLAYING_ID3));
|
bool was_valid = valid_mp3entry(id3_get(PLAYING_ID3));
|
||||||
|
|
||||||
playing_id3_sync(&info, -1, -1);
|
playing_id3_sync(&info, NULL);
|
||||||
|
|
||||||
if (!was_valid)
|
if (!was_valid)
|
||||||
{
|
{
|
||||||
|
@ -2626,7 +2627,7 @@ static void audio_begin_track_change(enum pcm_track_change_type type,
|
||||||
if (audio_start_codec(!track_skip_is_manual))
|
if (audio_start_codec(!track_skip_is_manual))
|
||||||
{
|
{
|
||||||
if (track_skip_is_manual)
|
if (track_skip_is_manual)
|
||||||
playing_id3_sync(&info, -1, -1);
|
playing_id3_sync(&info, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2903,7 +2904,7 @@ static void audio_start_playback(const struct audio_resume_info *resume_info,
|
||||||
/* This is the currently playing track - get metadata, stat */
|
/* This is the currently playing track - get metadata, stat */
|
||||||
struct track_info info;
|
struct track_info info;
|
||||||
track_list_current(0, &info);
|
track_list_current(0, &info);
|
||||||
playing_id3_sync(&info, resume.elapsed, resume.offset);
|
playing_id3_sync(&info, &resume);
|
||||||
|
|
||||||
if (valid_mp3entry(id3_get(PLAYING_ID3)))
|
if (valid_mp3entry(id3_get(PLAYING_ID3)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue