Skip to content

BlackVideo Mini Player v1.1.0 — Audio, Stability & Icon

Choose a tag to compare

@LoneStamp LoneStamp released this 01 Mar 06:30
Screenshot

✅ What's in This Release

🔊 Working Audio Playback

Audio now plays correctly for all common video formats. Previous builds were silent or produced scraping and choppy distortion every ~2 seconds.

  • Fixed planar audio format support (AV_SAMPLE_FMT_FLTP / fmt=8) — AAC and MP3 audio tracks in MP4 files now decode cleanly. The old code only passed data[0] (left channel plane) to swr_convert; all planes are now forwarded correctly via bv_swr_convert_frame() in C, which passes frame->data directly to libswresample.
  • Fixed SDL_MixAudioFormat self-mix bug — the callback was passing the output stream as both source and destination, doubling amplitude on every audio callback and causing audible clipping and distortion. Fixed by copying ring buffer data into a temporary buffer first, then mixing Tmp → Stream.
  • Resampler supports any input rate/format — 48000 Hz source files (Blu-ray rips, etc.) now convert cleanly to S16 stereo 44100 Hz for SDL2 output.
  • Ring buffer doubled to 256 KiB (~1.5 s capacity) to absorb decode bursts without dropping samples.
  • SDL audio buffer lowered to 2048 samples for lower output latency.

🎬 Correct Video Playback Speed

Video no longer runs slower than its source FPS.

  • Main loop now measures actual elapsed time per frame using SDL_GetTicks and sleeps only the remaining budget. Previously SDL_Delay(frame_ms) ran after decoding, meaning decode + scale + upload time stacked on top of the frame interval.
  • 60 fps video now plays at 60 fps; 24 fps at 24 fps.

💾 Fixed Heap Exhaustion Crash

The player no longer crashes with STORAGE_ERROR: heap exhausted after a few seconds.

  • Root cause: every decoded video frame allocated a fresh ~6.5 MB Ada heap buffer for RGB pixel data and leaked it. At 60 fps this consumed ~390 MB/sec of heap with no reclaim.
  • Fixed by pre-allocating a single RGB_Buffer at open time and reusing it every frame. Zero heap allocation per frame.

🪲 Fixed Wrong Stream Routing (NAL Unit Spam)

Hundreds of [h264] Invalid NAL unit size errors per second are gone.

  • Root cause: Ada's hardcoded AVPacket.stream_index offset (36) was wrong for FFmpeg 8.x. Audio packets were misidentified as video and sent to the H.264 decoder, which tried to parse AAC audio as NAL units.
  • Fixed with bv_packet_stream_index() — a C helper that reads stream_index via the real FFmpeg header so the offset is always correct regardless of FFmpeg version.

🔗 GNAT 2021 Windows Archive Linker Fix

Eliminated the persistent archive has no index; run ranlib build failure.

  • Root cause: GPRbuild recreates the mixed Ada+C archive during bind+link, overwriting any manual ranlib fix.
  • Fixed by removing C from the GPR project entirely. ffmpeg_helpers.c is compiled by build.bat using gcc directly and passed as an explicit .o to the linker — no archive, no ranlib.

🖼️ Custom Application Icon

The executable now shows the BlackVideo icon in Explorer, the taskbar, and the title bar.

  • resources/blackvideo.o (compiled from blackvideo.rc via windres) is linked in the GPR Linker package under the windows case.
  • Windows-only — does not affect Linux or macOS builds.

🛠️ Build Script Hardening (build.bat)

  • Detects and deletes stale .adb body files that caused spec does not allow a body errors.
  • Compiles ffmpeg_helpers.c separately with gcc before invoking gprbuild.
  • Validates FFmpeg headers and .a import libraries before building, with clear errors on missing files.
  • Copies runtime DLLs to build\ on success.

🎮 Keyboard Controls

Key Action
SPACE Play / Pause
/ Seek −5 / +5 seconds
/ Volume +10 / −10
M Mute / Unmute
F Fullscreen toggle
ESC or Q Quit

📦 Requirements (Windows)

  • Windows 10 / 11 x64
  • FFmpeg 8.x shared DLLs in build\: avcodec-62.dll, avformat-62.dll, avutil-60.dll, swscale-9.dll, swresample-6.dll
  • SDL2.dll in build\
  • GNAT Community 2021 (build-time only)

🚀 Usage

blackvideo-player.exe "C:\path\to\video.mp4"
blackvideo-player.exe --help

Download

Installer

Download blackvideo-mini-player

Built with Ada 2012 · FFmpeg 8.x · SDL2 · GNAT Community 2021

For BlackVideo mini player support

Full Changelog: https://github.com/BlackBlazent/blackvideo-mini-player/commits/1.1.0