|
From: <pl...@ip...> - 2005-08-25 23:28:29
|
Hi all, I discovered, that dv_cleanup(void) frees all statically allocated memory= . The problem is, that the right time for calling this function cannot be determined, if we have a modular program (e.g. which does en- and decodin= g in multiple threads). Reference counting isn't always possible, since plugin based apps don't even know, if libdv is used by some plugin or not. Possible solutions are: - Include a reference counter into libdv, which is increased by dv_init() and decreased by dv_cleanup(). Should be thread save ideally. - Better solution IMHO: Call dv_cleanup() automatically by a function, which has __attribute__ ((destructor)). This is a gcc only solution, but It's portable and works fine in ffmpeg and libquicktime. Any thoughts? BTW I use libdv ONLY for extracting the audio samples from a DV frame. Actual decoding is done via libavcodec. If there are better solutions for this task (except libavformat), let me know. I need this for decoding raw DV streams and type 1 DV AVIs, code is here: http://cvs.sourceforge.net/viewcvs.py/gmerlin/gmerlin_avdecoder/lib/dvfra= me.c?rev=3D1.3&view=3Dmarkup Please CC me, I'm not subscribed. Cheers Burkhard |