Skip to content

POC: SDL-backed audio path for ncplayer#2906

Open
rebroad wants to merge 23 commits intodankamongmen:masterfrom
rebroad:AddAudio
Open

POC: SDL-backed audio path for ncplayer#2906
rebroad wants to merge 23 commits intodankamongmen:masterfrom
rebroad:AddAudio

Conversation

@rebroad
Copy link
Copy Markdown

@rebroad rebroad commented Nov 29, 2025

Summary

  • turn on -Werror globally so warnings fail fast, and export loglevel so helper objects (like the SDL backend) can link against the shared visibility symbol
  • add src/media/audio-output.[ch]: SDL2 is dlopened on demand, exposes a ring buffer + clock helpers, and is only compiled into ncplayer; CMake now wires in SWRESAMPLE consistently
  • extend the FFmpeg glue with an audio packet queue, pending-packet drain, resampler helpers, and logging so the decoder can survive EAGAIN without dropping audio
  • update ncplayer to spin a dedicated audio thread, feed the new helpers, throttle logging, and drop video frames when lagging so audio keeps pace

Status

Proof-of-concept. Audio logging still hardcodes /tmp/ncplayer_audio.log, SDL2 is a runtime dependency for ncplayer, and the commits are intentionally chunky for early review. I plan to follow up by gating logging behind env/flags and splitting out the pacing/audio pieces further if this general direction sounds good.

Testing

  • cmake --build build -j$(nproc) on Ubuntu 24.04 (FFmpeg 7.0, SDL 2.28)
  • ./build/ncplayer (invocation without args) just to confirm the binary launches with the new audio plumbing

@rebroad rebroad force-pushed the AddAudio branch 2 times, most recently from cab01ae to b8c3fb8 Compare December 1, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant