Closed deltabeard closed 6 years ago
It doesn't. Though audio frames are not necessarily perfectly aligned with video frames.
Thanks for your reply. I'm looking into adding an audio driver to mpv that stores audio samples in a buffer that can then be retrieved using a function declared in client.h. All for the purpose of writing a libretro mpv core.
Potentially you could just use the internal pull API (like ao_sdl.c or ao_jack.c do), then you don't really need a buffer. But depends on the API user requirements. Also getting a timestamp to sync it with video will probably be a pain.
Thanks, I'll have a look. I was using the simple ao_pcm.c audio driver as a guideline to see if I can properly pass samples to libretro, and then I'll look in to issues such as syncing. I'll try and write a decent solution.
Edit: The pull API seems to be exactly what I need! Links for my future self: pull.c internal.h
Could this be something that could be added as an official feature? https://github.com/libretro/libretro-mpv/commit/ef16a4045e36cb9acd87ef2632d57f7380494781
Does libmpv have an audio callback feature that returns audio samples for a video frame?
Thanks.