void ff_thread_report_progress(ThreadFrame *f, int n, int field)

{

    PerThreadContext *p;

    atomic_int *progress = f->progress ? (atomic_int*)f->progress->data : NULL;



    if (!progress ||

        atomic_load_explicit(&progress[field], memory_order_acquire) >= n)

        return;



    p = f->owner->internal->thread_ctx;



    if (f->owner->debug&FF_DEBUG_THREADS)

        av_log(f->owner, AV_LOG_DEBUG, "%p finished %d field %d\n", progress, n, field);



    pthread_mutex_lock(&p->progress_mutex);



    atomic_store(&progress[field], n);



    pthread_cond_broadcast(&p->progress_cond);

    pthread_mutex_unlock(&p->progress_mutex);

}

void ff_thread_report_progress(ThreadFrame *f, int n, int field)

{

    PerThreadContext *p;

    atomic_int *progress = f->progress ? (atomic_int*)f->progress->data : NULL;



    if (!progress ||

        atomic_load_explicit(&progress[field], memory_order_acquire) >= n)

        return;



    p = f->owner->internal->thread_ctx;



    if (f->owner->debug&FF_DEBUG_THREADS)

        av_log(f->owner, AV_LOG_DEBUG, "%p finished %d field %d\n", progress, n, field);



    pthread_mutex_lock(&p->progress_mutex);



    atomic_store(&progress[field], n);



    pthread_cond_broadcast(&p->progress_cond);

    pthread_mutex_unlock(&p->progress_mutex);

}

void FUNC_0(ThreadFrame *VAR_0, int VAR_1, int VAR_2)

{

    PerThreadContext *p;

    atomic_int *progress = VAR_0->progress ? (atomic_int*)VAR_0->progress->data : NULL;



    if (!progress ||

        atomic_load_explicit(&progress[VAR_2], memory_order_acquire) >= VAR_1)

        return;



    p = VAR_0->owner->internal->thread_ctx;



    if (VAR_0->owner->debug&FF_DEBUG_THREADS)

        av_log(VAR_0->owner, AV_LOG_DEBUG, "%p finished %d VAR_2 %d\VAR_1", progress, VAR_1, VAR_2);



    pthread_mutex_lock(&p->progress_mutex);



    atomic_store(&progress[VAR_2], VAR_1);



    pthread_cond_broadcast(&p->progress_cond);

    pthread_mutex_unlock(&p->progress_mutex);

}

void FUNC_0(ThreadFrame *VAR_0, int VAR_1, int VAR_2)
{ PerThreadContext *p; atomic_int *progress = VAR_0->progress ? (atomic_int*)VAR_0->progress->data : NULL; if (!progress ||
atomic_load_explicit(&progress[VAR_2], memory_order_acquire) >= VAR_1)
return; p = VAR_0->owner->internal->thread_ctx; if (VAR_0->owner->debug&FF_DEBUG_THREADS)
av_log(VAR_0->owner, AV_LOG_DEBUG, "%p finished %d VAR_2 %d\VAR_1", progress, VAR_1, VAR_2); pthread_mutex_lock(&p->progress_mutex); atomic_store(&progress[VAR_2], VAR_1); pthread_cond_broadcast(&p->progress_cond); pthread_mutex_unlock(&p->progress_mutex); }