1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Aidan MacDonald 2022-11-14 19:43:17 +00:00
parent 5fdd491ceb
commit ea61347a0b

View file

@ -130,7 +130,10 @@ 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
* by a factor of 2. This is done via using sbr_fac. */
@ -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;