aboutsummaryrefslogtreecommitdiff
path: root/tests/m4a/run.sh
diff options
context:
space:
mode:
authorYP3 Audiobook <noreply@example.invalid>2026-11-27 00:51:12 +0000
committerYP3 Audiobook <noreply@example.invalid>2026-11-27 00:51:12 +0000
commit7a06b5d2d7ac329dc5cba794b019ba185b9b09e2 (patch)
treefac537bb029a8532aadec97816292c3074b9e608 /tests/m4a/run.sh
parent4b670f7ac2635de6d6583d603d97f0bcfbec6733 (diff)
downloadyp3-audiobook-firmware-7a06b5d2d7ac329dc5cba794b019ba185b9b09e2.tar.gz
Release 1.1
- Hold Up/Down to keep changing the volume - Pulling the SD card powers the player off instead of crashing; with no card at power-on it says so and turns off - Long M4B books load without freezing the controls, with a "Loading book N%" screen - The Center press that powers the player on no longer pauses the book as it resumes (which also made it load twice) - No "Bookmark saved" pause at power-off - USB disk shows up right away while a book loads (flasher's "NO USB DISK") - tests/m4a: host test of the M4B index loader
Diffstat (limited to 'tests/m4a/run.sh')
-rwxr-xr-xtests/m4a/run.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/m4a/run.sh b/tests/m4a/run.sh
new file mode 100755
index 0000000..0a1a98e
--- /dev/null
+++ b/tests/m4a/run.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Host check of libm4a's index parser (lib/rbcodec/codecs/libm4a/demux.c):
+# runs qtmovie_read() on an M4B through a model of the playback buffer and
+# prints the seek table it builds and what it cost (buffer calls, card
+# reads, rebuffers, yields).
+#
+# tests/m4a/run.sh FILE.m4b [HEAP_BYTES] [ROCKBOX_TREE] [STOP_AFTER]
+# STOP_AFTER: load_progress says "stop" from that call on, and the load
+# must give up there.
+set -eu
+HERE=$(cd "$(dirname "$0")" && pwd)
+REPO=$(cd "$HERE/../.." && pwd)
+FILE=$1
+HEAP=${2:-65536}
+TREE=${3:-$REPO/build/rockbox}
+STOP=${4:-}
+M4A=$TREE/lib/rbcodec/codecs/libm4a
+T=$(mktemp -d)
+trap 'rm -rf "$T"' EXIT
+# m4a.c's stream_* helpers, up to stream_create() (its seek code needs the
+# whole codec API)
+awk '{print} /^void stream_create/{f=1} f && /^}/{exit}' "$M4A/m4a.c" > "$T/stream.c"
+gcc -O2 -g -fsanitize=address,undefined -fno-sanitize-recover=all \
+ -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable \
+ -I"$HERE/shim" -I"$M4A" -o "$T/harness" \
+ "$HERE/harness.c" "$M4A/demux.c" "$T/stream.c"
+"$T/harness" "$FILE" "$HEAP" $STOP