[FFmpeg-devel] [PATCH] pthread_frame: save the FF_DEBUG_THREADS option in FrameThreadContext.

Wan-Teh Chang wtc at google.com
Sun Jul 9 01:38:11 EEST 2017

Hi Ronald,

On Sat, Jul 8, 2017 at 2:33 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> I can see the design from the patch.
> What's missing is a justification for the downside of the design, which is
> that updates to this variable by the user are no longer propagated to the
> worker threads.

My justification is the YAGNI principle.

Although the current code allows the FF_DEBUG_THREADS option to be
toggled dynamically, I believe that was not intended, and I believe
nobody actually does that. In my (admittedly limited) code search, I
only see the FF_DEBUG_THREADS option set via the -debug thread_ops
command-line option.

> The syncing is extremely trivial (simply by moving the
> assignment from init to update_from_user) and has no threading implications
> (since it's a boolean, so you can make it atomic) so this really shouldn't
> be a big deal to amend.

Yes, the syncing is trivial to add. When someone actually needs to
toggle the FF_DEBUG_THREADS option dynamically, we can easily add the
syncing at that time.

This is your call. Please let me know your decision. Thanks!

Wan-Teh Chang

More information about the ffmpeg-devel mailing list