Sorry for the delay in reply, I havn't had time to look into my code until now.
Dogness said:
From my debugging info, that callback is basically performing a memcpy of the same data into the same destination over and over again. This can't be on purpose, can it?
If I step through my ogg vorbis code, it calls the red callback 4-5 times (depending on the file, but the same file always has the same number of reads), and each time it is definatly reading
different data to the same destination.
The same destination is obviously ok (it is probably some kind on internal buffer), but I would be worried about it reading the same data again and again in your code - Are you incrementing your file buffer so it takes into account how much has been read so far?
Dogness said:
The problem is that each call to ov_open_callbacks() generates 8-11 "calls" to the callback function.
Having stepped through all my code, I can happily say I have no idea what it is reading when it does these initial calls. But it does seem to just move around the file, rather than reading it sequentially.
I
think it intially reads the header, and then the footer of the file format. Maybe it needs this data to correctly decompress the content?
Dogness said:
So, when the program attempts to open 40 OGG files in a short period of time, it ends up generating a minumum of (40*8=)320 callbacks. This is not good.
As I said before, if this is in your set-up routine, don't worry about it. 320 calls to a callback it not ideal, but if its not effecting the running of the application it's fine.
Of course, if you are doing this at runtime, it may be a problem. But what are you using 40 ogg files for? It seems like a large number to be loading all within a short space of time, in fact it seems like a large number to be loading at all!
Dogness said:
At this point, we have a workaround.
What is your work around? Do this stop the 8-10 calls to the callback? If so, does everything still stream smoothly, and do the ov_comment and ov_info functions still work?
Spree