]> git.sesse.net Git - ffmpeg/commit
lavc: remove complex debug code around avcodec init locking
authorwm4 <nfxjfg@googlemail.com>
Thu, 21 Dec 2017 22:03:24 +0000 (23:03 +0100)
committerwm4 <nfxjfg@googlemail.com>
Tue, 26 Dec 2017 01:50:00 +0000 (02:50 +0100)
commit4ed66517c62c599701b3793fa2843d5a8530a4f4
treed3cd8ed810ab76839e40708adcdfca81a80e1257
parent86a13bf2ffb40d44260d5747a4782a42a43a1ed8
lavc: remove complex debug code around avcodec init locking

This is just a lot of complicated and confusing code that had no purpose
anymore.

Also, the functions return values were checked only sometimes. Locking
shouldn't fail anyway, so remove the return values. Barely any other
pthread lock calls check the return value (including more important code
that is more likely to fail horribly if locking fails).

It could be argued that it might be helpful in some debugging
situations, or when the user built FFmpeg without thread support against
all good advice.

But there are dummy atomics too, so the atomic check won't help with
ensuring correctness absolutely. You gain very little.

Also, for debugging, you can just raise the ASSERT_LEVEL, and then
libavutil/thread.h will redefine the locking functions to explicitly
check the return values.
libavcodec/internal.h
libavcodec/utils.c