-
Hi! I'm working on integrating the FDK AAC decoder into Miniaudio. I successfully got it working as a custom decoder backend as per the libvorbis example. Now I'm generating bindings to use the Miniaudio library from a different programming language. To this end, I integrated my updates with the 'split' version of miniaudio. I also attempted to add the AAC/M4A support directly into the library rather than as a custom backend, so it would all be bundled together / 'just work' from the perspective of my client code. My attempt is here, where the The issue I'm having is at the
My first assumption was that the code that integrates custom decoder backends handles any (non-essential) unimplemented functions for you, and so that may not be happening here, which is why my code worked as a custom decoder but not when integrated directly. However, from what I can tell the unimplemented functions are handled for 'supported' decoders as well. For reference, here's my decoding backend vtable definition:
So my questions are:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Got a bit more info here: My decoder seems to work fine if I open with |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay. What are you returning from your custom decoder's |
Beta Was this translation helpful? Give feedback.
-
Are you able to post a full call stack at the time of the error? You were saying both I looked at your code (I somehow missed your mention of it earlier) and I can't see any glaringly obvious errors. There is one error, however (not sure if it's causing this particular issue though), and that is your custom channel map |
Beta Was this translation helpful? Give feedback.
OK, I see what you're saying. I thought you were talking about the implementation of miniaudio's
onSeek
callback, not the FFmpeg seek callback. I don't think there will be an elegant way to solve this. It's messy, but one thing you could do is calculate the size of the file yourself in terms ofonRead
(that's miniaudio'sma_read_proc
, not FFmpeg's callback). Run that in a loop, with the output buffer just being a temp buffer on the stack (you'll ignore that data) and then accumulate the number of bytes read from each call toonRead
. Then terminate the loop whenonRead
returnsMA_AT_END
, or the output byte count is less than what you requested. Then seek back to the start withonSeek
. Then…