History

do O(1) instead of O(n) atomic operations in register functions

about 1ms faster startup time

Michael Niedermayer committed 12 years ago

Commit 133fbfc1 parent 2b215f33 files · +6 −5Browse files

Showing the changes to libavfilter/avfilter.c (1 of 3 files). Show all

Unified · Split

libavfilter/avfilter.c+1−1
@@ -490,7 +490,7 @@ int avfilter_register(AVFilter *filter) · 489 unmodified lines
490 490
491 filter->next = NULL;491 filter->next = NULL;
492 492
493 while(avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))493 while(*f || avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))
494 f = &(*f)->next;494 f = &(*f)->next;
495 495
496 return 0;496 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t