mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Fix playing_id3_sync not properly syncing resume data
Fixes bookmark resume for tracks with different sample rates (should fix FS#13295) Change-Id: I69c77f9397f9230381c31e7cf8b586bcbacd06fe
This commit is contained in:
parent
4fb37ecbc6
commit
3d5dd97c48
1 changed files with 8 additions and 22 deletions
|
@ -1261,34 +1261,20 @@ static void playing_id3_sync(struct track_info *user_infop,
|
|||
id3_mutex_lock();
|
||||
|
||||
struct mp3entry *id3 = bufgetid3(user_infop->id3_hid);
|
||||
struct mp3entry *playing_id3 = id3_get(PLAYING_ID3);
|
||||
|
||||
pcm_play_lock();
|
||||
|
||||
unsigned long e = playing_id3->elapsed;
|
||||
unsigned long o = playing_id3->offset;
|
||||
|
||||
id3_write(PLAYING_ID3, id3);
|
||||
|
||||
if (elapsed == (unsigned long)-1)
|
||||
{
|
||||
playing_id3->elapsed = e;
|
||||
elapsed = 0;
|
||||
}
|
||||
|
||||
if (offset == (unsigned long)-1)
|
||||
{
|
||||
playing_id3->offset = o;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
pcm_play_unlock();
|
||||
|
||||
if (id3)
|
||||
{
|
||||
id3->elapsed = elapsed;
|
||||
id3->offset = offset;
|
||||
if (elapsed != (unsigned long)-1)
|
||||
id3->elapsed = elapsed;
|
||||
|
||||
if (offset != (unsigned long)-1)
|
||||
id3->offset = offset;
|
||||
}
|
||||
id3_write(PLAYING_ID3, id3);
|
||||
|
||||
pcm_play_unlock();
|
||||
|
||||
id3_mutex_unlock();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue