summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-06 15:24:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-06 15:27:36 +0100
commit133fbfc7811ffae7b97dd129fcd0b5e646742362 (patch)
tree9114fed08d3d1b9b801e702b25a40a1e1df47c8b /libavfilter
parent2b215f39391c0f9ddb547d16d568776e9e5da54d (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>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfilter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 14ce55f932..2567ce92c1 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -490,7 +490,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;