about 1ms faster startup time
Unified · Split
| @@ -206,7 +206,8 @@ av_cold void avcodec_register(AVCodec *codec) · 205 unmodified lines | ||
| 206 | 206 | avcodec_init(); |
| 207 | 207 | p = &first_avcodec; |
| 208 | 208 | codec->next = NULL; |
| 209 | − while(avpriv_atomic_ptr_cas((void * volatile *)p, NULL, codec)) | |
| 209 | + | |
| 210 | + while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, codec)) | |
| 210 | 211 | p = &(*p)->next; |
| 211 | 212 | |
| 212 | 213 | if (codec->init_static_data) |
| @@ -3191,7 +3192,7 @@ void av_register_hwaccel(AVHWAccel *hwaccel) · 2978 unmodified lines | ||
| 3191 | 3192 | { |
| 3192 | 3193 | AVHWAccel **p = &first_hwaccel; |
| 3193 | 3194 | hwaccel->next = NULL; |
| 3194 | − while(avpriv_atomic_ptr_cas((void * volatile *)p, NULL, hwaccel)) | |
| 3195 | + while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, hwaccel)) | |
| 3195 | 3196 | p = &(*p)->next; |
| 3196 | 3197 | } |
| 3197 | 3198 | |
| @@ -490,7 +490,7 @@ int avfilter_register(AVFilter *filter) · 489 unmodified lines | ||
| 490 | 490 | |
| 491 | 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 | 494 | f = &(*f)->next; |
| 495 | 495 | |
| 496 | 496 | return 0; |
| @@ -54,7 +54,7 @@ void av_register_input_format(AVInputFormat *format) · 53 unmodified lines | ||
| 54 | 54 | AVInputFormat **p = &first_iformat; |
| 55 | 55 | |
| 56 | 56 | format->next = NULL; |
| 57 | − while(avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format)) | |
| 57 | + while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format)) | |
| 58 | 58 | p = &(*p)->next; |
| 59 | 59 | } |
| 60 | 60 | |
| @@ -63,7 +63,7 @@ void av_register_output_format(AVOutputFormat *format) · 2 unmodified lines | ||
| 63 | 63 | AVOutputFormat **p = &first_oformat; |
| 64 | 64 | |
| 65 | 65 | format->next = NULL; |
| 66 | − while(avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format)) | |
| 66 | + while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format)) | |
| 67 | 67 | p = &(*p)->next; |
| 68 | 68 | } |
| 69 | 69 | |