]> git.sesse.net Git - ffmpeg/commit
asrc_flite: do not crash on multiple instances.
authorNicolas George <nicolas.george@normalesup.org>
Sat, 28 Jul 2012 09:53:18 +0000 (11:53 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sat, 28 Jul 2012 13:13:46 +0000 (15:13 +0200)
commit4ce87ecf2a8a8a9348f9bdbb420f3bee92e6513f
tree9f5eeb097060816e870e4cf394c96030bc6433ad
parentfb0688b079c3751bcd4d64200280858a33e0b9cc
asrc_flite: do not crash on multiple instances.

The voice register functions return the same voice structure
upon multiple registration. It causes us two problems:

If we delete a voice without deregistering it, it leaves
a dangling pointer inside the library.

If we delete or unregister a voice at uninit, it may still
be in use by another instance of the filter.

The second problem is solved by keeping an usage counter inside
asrc_flite. This is not thread-safe, but neither is flite itself.
doc/filters.texi
libavfilter/asrc_flite.c