I've tried searching for this but I can't find a specific thread about what I'm seeing.
Code:
//FLAC METADATA_BLOCK_STREAMINFO
struct streaminfo {
uint16_t min_block_size:16; //16 bits, 0 bits left
uint16_t max_block_size:16; //32 bits, 0 bits left
uint32_t min_frame_size:24; //64 bits, 8 bits left
uint32_t max_frame_size:24; //96 bits, 16 bits left
uint32_t sample_rate:20; //128 bits, 28 bits left
uint32_t num_channels:3; //128 bits, 25 bits left
uint32_t bits_per_sample:5; //128 bits, 20 bits left
uint64_t total_samples:36; //192 bits, 48 bits left
uint32_t md5_sig1:32; //Why doesn't this fit in the 192?
//uint16_t md5_sig2:16;
} __attribute__ ((packed));
Have I done my math right? Shouldn't that fit in the remainder of the allocated bits? I'm doing a sizeof() on my system and I'm getting 28 bytes (224 bits).
FYI I'm using gcc 4.8.0 (mingw32).
Thanks!
Edit: Should alignment be a concern? 192 bits (24 bytes) is divisible by 4 bytes, which I think is the default alignment.