Displaying 2 results from an estimated 2 matches for "contentoffset".
2010 Jun 23
0
FLAC StreamInfo Parsing
...,
ofs, n); with n > 1, and that's wrong. You cannot look ahead in a
stream, and so your code is already doing things in a way that is not
to spec. You then use array indexes and bit shift operators to build
multi-byte values. What's worse, I see that your code is looking at
(contentOffset - 1), which is really bad.
What you need to do is write a bitStream function. It should only
read each byte from the stream once and completely deal with all 8
bits before dealing with the next byte. You should never look ahead
beyond the current byte. Instead, you need a long long accumu...
2010 Jun 23
3
FLAC StreamInfo Parsing
Thank you very much! But how to deal with endianness in the case of
bit stream? Some blocks (for example MinBlockSize) require 16bits
(simply swap first and second), some block (e.g.MinFrameSize) require
3 byte-array to be reverted.
Finally totalSamples is stored in 5 bytes ( only last 4 bits from
first one byte are used). It was a real issue to make it little-endian
(here is how I did it: