summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-11-14 19:43:17 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-11-16 06:48:22 -0500
commitea61347a0b10154f0b346ae8de013b13cd19dd8a (patch)
treea95dd1e0bd8e90b546d878c0461008d6f3cb98f9
parent5fdd491ceb6a440403cbf97eb33d6dcc80be31a8 (diff)
downloadrockbox-ea61347a0b.tar.gz
rockbox-ea61347a0b.zip
codecs: aac: Prefer to resume by time instead of offset
m4a_seek_raw() is relatively inaccurate, so time-based resume should be preferred. Change-Id: I959ef165f9a99d12deb804c13d20413c1cecf867
-rw-r--r--lib/rbcodec/codecs/aac.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c
index c00946f227..b470fd9622 100644
--- a/lib/rbcodec/codecs/aac.c
+++ b/lib/rbcodec/codecs/aac.c
@@ -130,9 +130,12 @@ enum codec_status codec_run(void)
i = 0;
- if (file_offset > 0) {
+ if (param) {
+ elapsed_time = param;
+ action = CODEC_ACTION_SEEK_TIME;
+ } else if (file_offset > 0) {
/* Resume the desired (byte) position. Important: When resuming SBR
- * upsampling files the resulting sound_samples_done must be expanded
+ * upsampling files the resulting sound_samples_done must be expanded
* by a factor of 2. This is done via using sbr_fac. */
if (m4a_seek_raw(&demux_res, &input_stream, file_offset,
&sound_samples_done, (int*) &i)) {
@@ -142,9 +145,6 @@ enum codec_status codec_run(void)
}
NeAACDecPostSeekReset(decoder, i);
elapsed_time = sound_samples_done * 1000LL / ci->id3->frequency;
- } else if (param) {
- elapsed_time = param;
- action = CODEC_ACTION_SEEK_TIME;
} else {
elapsed_time = 0;
sound_samples_done = 0;