@@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/atomic.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
@@ -62,9 +61,11 @@ void av_register_input_format(AVInputFormat *format)
{
AVInputFormat **p = last_iformat;
- // Note, format could be added after the first 2 checks but that implies that *p is no longer NULL
- while(p != &format->next && !format->next && avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
- p = &(*p)->next;
+ /* Iterate through the list until the last entry has been reached */
+ while (p != &format->next && !format->next) {
+ *p = format;
+ p = &(format)->next;
+ }
if (!format->next)
last_iformat = &format->next;
@@ -74,9 +75,11 @@ void av_register_output_format(AVOutputFormat *format)
{
AVOutputFormat **p = last_oformat;
- // Note, format could be added after the first 2 checks but that implies that *p is no longer NULL
- while(p != &format->next && !format->next && avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
- p = &(*p)->next;
+ /* Iterate through the list until the last entry has been reached */
+ while (p != &format->next && !format->next) {
+ *p = format;
+ p = &(format)->next;
+ }
if (!format->next)
last_oformat = &format->next;
Same as previous commit, unneded use of atomics. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com> --- libavformat/format.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)