bad hack to fix sync after seek
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5736 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -208,15 +208,18 @@ mp3Decoder::DecodeNextChunk()
|
|||||||
|
|
||||||
// resync after a seek
|
// resync after a seek
|
||||||
if (fNeedSync) {
|
if (fNeedSync) {
|
||||||
while (chunkSize > 100) {
|
if (chunkSize > 5200) { // mp3 reader always delivers synced frames smaller than 5200 bytes
|
||||||
if (IsValidStream((uint8 *)chunkBuffer, chunkSize))
|
// wav reader and others don't do that
|
||||||
break;
|
while (chunkSize > 100) {
|
||||||
chunkBuffer = (uint8 *)chunkBuffer + 1;
|
if (IsValidStream((uint8 *)chunkBuffer, chunkSize))
|
||||||
chunkSize--;
|
break;
|
||||||
}
|
chunkBuffer = (uint8 *)chunkBuffer + 1;
|
||||||
if (chunkSize <= 100) {
|
chunkSize--;
|
||||||
TRACE("mp3Decoder::Decode: Sync failed\n");
|
}
|
||||||
return B_ERROR;
|
if (chunkSize <= 100) {
|
||||||
|
TRACE("mp3Decoder::Decode: Sync failed\n");
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fNeedSync = false;
|
fNeedSync = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define TRACE(a...)
|
#define TRACE(a...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BUFFER_SIZE 16384
|
#define BUFFER_SIZE 16384 // must be > 5200 for mp3 decoder to work
|
||||||
|
|
||||||
#define FOURCC(a,b,c,d) ((((uint32)(d)) << 24) | (((uint32)(c)) << 16) | (((uint32)(b)) << 8) | ((uint32)(a)))
|
#define FOURCC(a,b,c,d) ((((uint32)(d)) << 24) | (((uint32)(c)) << 16) | (((uint32)(b)) << 8) | ((uint32)(a)))
|
||||||
#define UINT16(a) ((uint16)B_LENDIAN_TO_HOST_INT16((a)))
|
#define UINT16(a) ((uint16)B_LENDIAN_TO_HOST_INT16((a)))
|
||||||
|
|||||||
Reference in New Issue
Block a user