Codecs: mpa: Use both time and offset when resuming files

The supplied time may be more accurate than the calculated time from the bitrate (can be quite inaccurate for long vbr files and even for cbr due to padding)

Change-Id: I1f8291eab45fbd91a161b51776c391a0f7886a5c
This commit is contained in:
Roman Artiukhin 2024-01-24 11:55:48 +02:00
parent 1122cae028
commit be16edc94b

View file

@ -462,7 +462,14 @@ enum codec_status codec_run(void)
} }
else { else {
ci->seek_buffer(ci->id3->offset); ci->seek_buffer(ci->id3->offset);
set_elapsed(ci->id3); if (ci->id3->elapsed && ci->id3->elapsed < ci->id3->length)
{
ci->set_elapsed(ci->id3->elapsed);
}
else
{
set_elapsed(ci->id3);
}
} }
} }
else if (ci->id3->elapsed) else if (ci->id3->elapsed)