finally understood why the use-after-free bug happened

This commit is contained in:
2024-09-25 04:13:37 +02:00
parent f444efc5af
commit 1142d83adb
4 changed files with 7 additions and 23 deletions
+1 -11
View File
@@ -54,14 +54,10 @@ main :: proc() {
// TODO: channel mapping is incorrect for anything with more than 2 channels.
channels := flac_data.metadata.channels
chmap := alsa.pcm_get_chmap(handle)
fmt.println(chmap)
md5_ctx: md5.Context
md5.init(&md5_ctx)
for {
frame, err := flac.read_next_frame(reader, flac_data)
frame, err := flac.read_next_frame(reader, flac_data, allocator)
if err != nil {
if err == .EOF {
break
@@ -83,12 +79,6 @@ main :: proc() {
}
}
fmt.println("Channels:", frame.channels)
if frame.channels == 6 {
fmt.println("Sample:", len(frame.samples))
}
// TODO: resampling
// 8 bps audio