[FFmpeg-devel] [PATCH] submit_thread should also lock the mutex that guards the source avctx (prev_thread->avctx) when calling update_context_from_thread.

Ronald S. Bultje rsbultje at gmail.com
Sat Feb 27 02:04:39 CET 2016


Hi,

On Fri, Feb 26, 2016 at 5:49 PM, Ronald S. Bultje <rsbultje at gmail.com>
wrote:

> Now, one could argue that maybe we shouldn't copy the value *at all* if we
> don't use it anyway, which would incidentally also make tools like tsan
> happy about this particular thingy. I'm not against that, if it doesn't
> make the code uglier.
>

To be a little bit more explicit, it should be relatively easy to
accomplish this by changing the position of qscale in the relevant struct,
and only copy that half of the struct (where entries are obviously grouped)
where we actually care about the copied value.

See e.g. the copy_fields macro [1] on how we do partial-struct copies.

Ronald

[1]
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/h264_slice.c;h=9a5bc3f63fb5c6aae3747a03657b8dc821c7d750;hb=HEAD#l427


More information about the ffmpeg-devel mailing list