BlackVideo Mini Player v2.2.0 — Playback Controls Fix & Audio Stability
✅ What's in This Release
🖱️ Fully Working Playback Controls
All on-screen buttons now respond correctly to mouse clicks.
- Fixed mouse button detection —
SDL_MouseButtonEvent.buttonwas being read from byte offset 13 instead of the correct offset 16 in the SDL2 struct layout (type@0 ·timestamp@4 ·windowID@8 ·which@12 ·button@16). Every click was registering as button 0 (nothing), making play/pause, loop, mute, speed, fullscreen, and seek-bar clicks all completely unresponsive. One offset fix restores all controls. - Fixed right-click context menu — right-click (button = 3) was never detected for the same reason. The context menu (Open File, Subtitle Track selection) now opens correctly on right-click anywhere on the video.
- Seek bar and progress scrubber remain fully functional — their
x/ycoordinate offsets were already correct.
🔊 Audio Stability Fix for Long Videos
Audio no longer becomes scattered, mixed, or distorted after ~50 minutes of playback.
- Fixed ring buffer race condition —
Push_Audio(main thread) andFill_Audio(SDL audio thread) both accessedRing_Avail,Ring_Read, andRing_Writewith no synchronisation. Torn reads accumulate silently and eventually produce audible corruption after extended runtime. Fixed by wrapping allPush_Audioring writes inSDL_LockAudioDevice/SDL_UnlockAudioDevice. - Ring buffer increased from 256 KB → 2 MB (~12 seconds at 44100 Hz stereo S16). H.264 decode bursts during complex scenes can produce audio faster than real-time for short periods; the larger buffer absorbs these without overflow.
- Overflow strategy changed — drop incoming, not buffered — the old code dropped the oldest buffered audio when the ring filled, causing audible clicks in audio that was about to play. The new code silently truncates the incoming burst instead, which is inaudible.
- Audio ring flushed on every seek —
Audio.Flushis now called after all seek paths (scrubber drag, click seek bar, Prev/Next buttons, keyboard ←/→, loop restart). Previously, stale pre-seek audio would bleed through for a fraction of a second after jumping to a new position. - Fixed SDL audio device sample rate —
SDL_AUDIO_ALLOW_FREQUENCY_CHANGEwas previously passed, allowing SDL to silently open the device at a different sample rate and causing subtle pitch drift or sync issues over long files. The device is now opened withAllowed_Changes = 0(exact 44100 Hz, S16 stereo required). - Added
SDL_LockAudioDevice/SDL_UnlockAudioDevicebindings tosdl-audio.ads. - Added
Audio.Flushprocedure toaudio.ads/audio.adb.
🏗️ Build System Fixes
ui_overlay.cmoved fromsrc/→csrc/— GPRbuild was scanningsrc/and compiling the C file as Ada, producing a duplicateui_overlay.othat caused multiple definition linker errors for everybv_ui_*symbol. Thecsrc/directory is outside GPRbuild's source scan.- C overlay now compiles to
ui_overlay_c.o(notui_overlay.o) to avoid collision with the Ada-compiledui_overlay.othat GPRbuild produces fromui_overlay.adb. - GPR linker uses
-l:libSDL2_ttf.dll.a(explicit import library filename) instead of-lSDL2_ttfto guarantee the DLL import path is used rather than any static archive. - Added
-lgdi32,-lusp10,-lrpcrt4to Windows linker flags, required by HarfBuzz Uniscribe inside SDL2_ttf. - Fixed SDL2_ttf / SDL2 link order —
libSDL2_ttfmust precedelibSDL2so the linker resolves SDL2_ttf's SDL2 dependencies correctly. build.batuses%ROOT%(absolute quoted path via%CD%) for all-Iand-oflags, fixing silent gcc failures when the project path contains spaces (e.g.Vilma E. Agripo).build.batdeletes stalebuild\obj\ui_overlay.obefore building to prevent leftover objects from prior broken builds causing duplicate symbol errors.
🎮 Controls
Keyboard
| Key | Action |
|---|---|
SPACE |
Play / Pause |
← / → |
Seek −5 / +5 seconds |
↑ / ↓ |
Volume +10 / −10 |
M |
Mute / Unmute |
L |
Loop toggle |
F |
Fullscreen toggle |
ESC or Q |
Quit |
UI Bar
| Control | Action |
|---|---|
| Seek bar | Click or drag to jump/scrub |
| ⏮ Prev | Seek to start |
| ⏯ Play/Pause | Toggle playback |
| ⏭ Next | Jump near end |
| 🔁 Loop | Toggle loop |
| 🔊 Volume | Mute/unmute |
1.0x Speed |
Cycle 0.5× / 1× / 1.5× / 2× (display only) |
| ⛶ Fullscreen | Toggle fullscreen |
| ⋮ Menu | Context menu — Open File, Subtitle tracks |
Right-click anywhere on the video to open the context menu directly.
📦 Requirements (Windows)
- Windows 10 / 11 x64
- Runtime DLLs in
build\:
| DLL | Source |
|---|---|
SDL2.dll |
SDL2 release page (MinGW) |
SDL2_ttf.dll |
SDL2_ttf-devel-2.0.12-VC |
libfreetype-6.dll |
Bundled with SDL2_ttf-devel-2.0.12-VC |
zlib1.dll |
Bundled with SDL2_ttf-devel-2.0.12-VC |
avcodec-62.dll |
FFmpeg shared build |
avdevice-62.dll |
FFmpeg shared build |
avfilter-11.dll |
FFmpeg shared build |
avformat-62.dll |
FFmpeg shared build |
avutil-60.dll |
FFmpeg shared build |
swresample-6.dll |
FFmpeg shared build |
swscale-9.dll |
FFmpeg shared build |
- GNAT Community 2021 (build-time only)
Important: Use
SDL2_ttf-devel-2.0.12-VCfor the SDL2_ttf DLL. Includelibfreetype-6.dllandzlib1.dllfrom that package alongsideSDL2_ttf.dllinbuild\.
🚀 Usage
blackvideo-player.exe "C:\path\to\video.mp4"
Built with Ada 2012 · FFmpeg 8.x · SDL2 · SDL2_ttf · GNAT Community 2021
Full Changelog: 1.1.0...v2.2.0
