mirror of
https://github.com/IllusionMan1212/flac-odin.git
synced 2026-10-24 02:12:29 +00:00
Cleanup comments, move internal stuff to be private, slightly improve read_bits(), start work on user-friendly stuff and options
This commit is contained in:
+13
-3
@@ -1,19 +1,29 @@
|
||||
package flac_example
|
||||
|
||||
import "core:fmt"
|
||||
import "core:mem"
|
||||
import "core:mem/virtual"
|
||||
import "core:os"
|
||||
import "core:time"
|
||||
|
||||
import "../"
|
||||
|
||||
main :: proc() {
|
||||
start := time.now()
|
||||
if len(os.args) < 2 {
|
||||
if len(os.args) < 2 {
|
||||
fmt.eprintln("Please provide a path to a flac file.")
|
||||
os.exit(1)
|
||||
}
|
||||
|
||||
err := flac.load_from_file(os.args[1])
|
||||
arena: virtual.Arena
|
||||
arena_err := virtual.arena_init_static(&arena, mem.Megabyte * 8)
|
||||
if arena_err != nil {
|
||||
fmt.eprintln("Failed to alloc memory")
|
||||
return
|
||||
}
|
||||
allocator := virtual.arena_allocator(&arena)
|
||||
|
||||
start := time.now()
|
||||
err := flac.load_from_file(os.args[1], allocator = allocator)
|
||||
if err != nil {
|
||||
fmt.eprintln(err)
|
||||
os.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user