Skip to content

BlackVideo Mini Player v2.2.0 — Playback Controls Fix & Audio Stability

Choose a tag to compare

@LoneStamp LoneStamp released this 05 Mar 11:39

✅ What's in This Release

🖱️ Fully Working Playback Controls

Screenshot

All on-screen buttons now respond correctly to mouse clicks.

  • Fixed mouse button detectionSDL_MouseButtonEvent.button was 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/y coordinate 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 conditionPush_Audio (main thread) and Fill_Audio (SDL audio thread) both accessed Ring_Avail, Ring_Read, and Ring_Write with no synchronisation. Torn reads accumulate silently and eventually produce audible corruption after extended runtime. Fixed by wrapping all Push_Audio ring writes in SDL_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 seekAudio.Flush is 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 rateSDL_AUDIO_ALLOW_FREQUENCY_CHANGE was 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 with Allowed_Changes = 0 (exact 44100 Hz, S16 stereo required).
  • Added SDL_LockAudioDevice / SDL_UnlockAudioDevice bindings to sdl-audio.ads.
  • Added Audio.Flush procedure to audio.ads / audio.adb.

🏗️ Build System Fixes

  • ui_overlay.c moved from src/csrc/ — GPRbuild was scanning src/ and compiling the C file as Ada, producing a duplicate ui_overlay.o that caused multiple definition linker errors for every bv_ui_* symbol. The csrc/ directory is outside GPRbuild's source scan.
  • C overlay now compiles to ui_overlay_c.o (not ui_overlay.o) to avoid collision with the Ada-compiled ui_overlay.o that GPRbuild produces from ui_overlay.adb.
  • GPR linker uses -l:libSDL2_ttf.dll.a (explicit import library filename) instead of -lSDL2_ttf to guarantee the DLL import path is used rather than any static archive.
  • Added -lgdi32, -lusp10, -lrpcrt4 to Windows linker flags, required by HarfBuzz Uniscribe inside SDL2_ttf.
  • Fixed SDL2_ttf / SDL2 link orderlibSDL2_ttf must precede libSDL2 so the linker resolves SDL2_ttf's SDL2 dependencies correctly.
  • build.bat uses %ROOT% (absolute quoted path via %CD%) for all -I and -o flags, fixing silent gcc failures when the project path contains spaces (e.g. Vilma E. Agripo).
  • build.bat deletes stale build\obj\ui_overlay.o before 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-VC for the SDL2_ttf DLL. Include libfreetype-6.dll and zlib1.dll from that package alongside SDL2_ttf.dll in build\.


🚀 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