[prev in list] [next in list] [prev in thread] [next in thread]
List: rockbox-cvs
Subject: flac: fix seeking.
From: gerrit () rockbox ! org
Date: 2013-11-18 6:46:02
Message-ID: 201311180646.rAI6k2Hn010315 () giant ! haxx ! se
[Download RAW message or body]
commit b770f639346fa8a40d07b9dcc66b3e378210b0a9
Author: Andrew Ryabinin <ryabinin.a.a@gmail.com>
Date: Sat Nov 9 21:42:18 2013 +0400
flac: fix seeking.
As comment in code states:
"It is possible for our seek to land in the middle of audio
data that looks exactly like a frame header from a future
version of an encoder. When that happens, frame_sync() will
return false. But there is a remote possibility that it is
properly synced at such a "future-codec frame", so to make sure,
we wait to see several "unparseable" errors in a row before
bailing out."
Currently we wait for 10 "unparseable" errors. libFLAC waits for 20.
But I've got a valid flac+cue, wherein switching to certain track
gave me 24 "unparsaeable" errors. Therefore I increased
unparseable_count to 30.
Change-Id: I4e97a5385c729adf3d5075d41ea312622c69e548
Reviewed-on: http://gerrit.rockbox.org/658
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Reviewed-by: Boris Gjenero <boris.gjenero@gmail.com>
Tested-by: Andrew Ryabinin <ryabinin.a.a@gmail.com>
Reviewed-by: Andrew Ryabinin <ryabinin.a.a@gmail.com>
diff --git a/lib/rbcodec/codecs/flac.c b/lib/rbcodec/codecs/flac.c
index 3c5545d..3390c24 100644
--- a/lib/rbcodec/codecs/flac.c
+++ b/lib/rbcodec/codecs/flac.c
@@ -352,7 +352,7 @@ static bool flac_seek(FLACContext* fc, uint32_t target_sample) {
unsigned unparseable_count;
bool got_a_frame = false;
for(unparseable_count = 0; !got_a_frame
- && unparseable_count < 10; unparseable_count++) {
+ && unparseable_count < 30; unparseable_count++) {
if(frame_sync(fc))
got_a_frame = true;
}
_______________________________________________
rockbox-cvs mailing list
rockbox-cvs@cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic