Add audio cache to avformat producer
I based this off of how producer_avformat.c does video caching. Seems to work fine and doesn't leak any more memory than melt did before this patchset.
I purposefully don't use mlt_frame_get_audio() because it sets *samples to zero.
This fixes #738
Thank you for your contribution.
I was reviewing some things today, and I agree to merge this if you simply "add a property to set the amount of audio caching. Leave it unset by default in which case it evaluates to 0 when getting it. Then, you can set it to a higher value for your needs."
I was reviewing some things today, and I agree to merge this if you simply "add a property to set the amount of audio caching. Leave it unset by default in which case it evaluates to 0 when getting it. Then, you can set it to a higher value for your needs."
Worksforme. I lost some interest in this patch because I wrote a URL caching FUSE thing instead. While audio caching helps, it does not help with mlt opening the same file/URL several times instead of just once. This means libavformat has to re-parse the file. This is especially bad with MXF files. I forget the exact number of times mlt re-opens the file, but it's something like seven. So if it takes ffprobe five seconds to probe a HTTP URL then it takes melt around thirty seconds..
This PR was implemented by https://github.com/mltframework/mlt/pull/903