summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Sampson <ats@offog.org>2016-08-26 13:42:03 +0100
committerMichael Giacomelli <giac2000@hotmail.com>2016-09-07 19:44:37 +0200
commit1f8ea9fe27313228e5df67ce6447830b5c30e5e3 (patch)
tree5b926da45ffd47e5028d7a48b4e65ad54cde3722
parentcf82f208e3ece54fd38cb7c90b77ad91aa3a4c8c (diff)
downloadrockbox-1f8ea9fe27313228e5df67ce6447830b5c30e5e3.tar.gz
rockbox-1f8ea9fe27313228e5df67ce6447830b5c30e5e3.zip
Opus: update resume offset correctly while playing.
The codec wasn't calling ci->set_offset() while decoding; as a result, the saved offset in ci.id3->offset was only updated at the start of the file and when seeking. To reproduce the problem in the simulator or on a real device: - Start playing an Opus file. - Let it play until 15s, then turn the player off. - Turn back on and resume playback. This'll resume correctly from 15s (using time-based resume, I think, as the offset was 0?). - Let it play until 30s, then turn the player off again. - Turn back on and resume playback. This'll resume from 15s, based on the initial position from last time, when it should resume from 30s. I believe this will also fix FS#12799 ("Resuming opus file from bookmark is not working correctly"). Change-Id: Iba67368e0029c968ef802693767e0722719bc38b
-rw-r--r--docs/CREDITS1
-rw-r--r--lib/rbcodec/codecs/opus.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/docs/CREDITS b/docs/CREDITS
index 841f1b76e8..fa0fc5b582 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -653,6 +653,7 @@ Udo Schläpfer
653Åka Sikrom 653Åka Sikrom
654Thomas White 654Thomas White
655Karl Huber 655Karl Huber
656Adam Sampson
656 657
657The libmad team 658The libmad team
658The wavpack team 659The wavpack team
diff --git a/lib/rbcodec/codecs/opus.c b/lib/rbcodec/codecs/opus.c
index 842803aa4f..058880c149 100644
--- a/lib/rbcodec/codecs/opus.c
+++ b/lib/rbcodec/codecs/opus.c
@@ -449,6 +449,7 @@ enum codec_status codec_run(void)
449 } 449 }
450 450
451 /* report progress */ 451 /* report progress */
452 ci->set_offset((size_t) ci->curpos);
452 ci->set_elapsed((granule_pos - header.preskip) / 48); 453 ci->set_elapsed((granule_pos - header.preskip) / 48);
453 454
454 /* Decode audio packets */ 455 /* Decode audio packets */