You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avfilter/avfilter: Make avfilter_register() thread safe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/atomic.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
@@ -465,11 +466,11 @@ int avfilter_register(AVFilter *filter)
|
|||||||
|| (!input->start_frame && !input->end_frame));
|
|| (!input->start_frame && !input->end_frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*f)
|
|
||||||
f = &(*f)->next;
|
|
||||||
*f = filter;
|
|
||||||
filter->next = NULL;
|
filter->next = NULL;
|
||||||
|
|
||||||
|
while(avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))
|
||||||
|
f = &(*f)->next;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user