Multiple improvements to OGG-FLAC format to better comply with xiph.org spec:
## Changes to streaming_ogg_flac_sink.rs
### 1. Fixed Identification Packet (BOS)
Previously included entire FLAC header (all metadata blocks) in the
identification packet. Now correctly extracts ONLY the STREAMINFO block.
Format now complies with spec:
- Bytes 0: 0x7F
- Bytes 1-4: "FLAC"
- Bytes 5-6: Version 0x01 0x00
- Bytes 7-8: Number of header packets = 1 (was 0, now corrected!)
- Bytes 9-12: "fLaC"
- Bytes 13+: STREAMINFO block only (38 bytes: type + length + 34 bytes data)
Result: Identification packet is now 51 bytes (was 95 bytes)
### 2. Improved FLAC Data Packetization
Changed from arbitrary 4KB chunks to 8KB chunks read directly from encoder.
While not perfect (true spec compliance requires one FLAC frame per OGG packet),
this reduces the chance of splitting frames and improves compatibility.
Proper FLAC frame parsing would require implementing a FLAC frame header parser,
which is complex. Current approach is a pragmatic compromise for streaming.
### 3. Added Debug Logging
- Log STREAMINFO block length (should be 34 bytes)
- Log extracted STREAMINFO size
- Log final identification packet size
- Helps verify spec compliance during development
## Testing
- Compilation successful
- Stream generates correct header size (141 bytes total: 51 + 90)
- STREAMINFO correctly extracted as 38 bytes
- Ready for VLC compatibility testing
## Known Limitations
- Granule position still 0 (should increment with sample count)
- FLAC frame boundaries not perfectly respected (would need frame parser)
- These may be addressed in future iterations if needed for compatibility