diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 18:24:10 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-24 04:05:47 +0400 |
commit | 66a9edfcf677f2673b5163f8008bdc7d0454074c (patch) | |
tree | 845edd94ea6a7acf0ca36ec378b01e06c330efb6 /libavfilter | |
parent | a9382fc15c15c0517e41db8a294afc4c7696ba19 (diff) |
do O(1) instead of O(n) atomic operations in register functions
about 1ms faster startup time
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 133fbfc7811ffae7b97dd129fcd0b5e646742362)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/avfilter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 251f6ae38d..e92f3e543b 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -468,7 +468,7 @@ int avfilter_register(AVFilter *filter) filter->next = NULL; - while(avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter)) + while(*f || avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter)) f = &(*f)->next; return 0; |