diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-11-23 07:23:31 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-11-25 05:26:49 +0100 |
commit | 785ffe67c86f3f9e3ffe736597da14795ef813c3 (patch) | |
tree | b438d0b69928d631069d895b85c5e6e086caba9b /fftools | |
parent | 224b62489d314e3c9637397cb7b95505651349e1 (diff) | |
download | ffmpeg-785ffe67c86f3f9e3ffe736597da14795ef813c3.tar.gz |
fftools/ffmpeg_sched: rename mux_done_{lock,cond} into finish_*
Their semantics will be changed in the following commit to not be
limited to muxing.
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffmpeg_sched.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fftools/ffmpeg_sched.c b/fftools/ffmpeg_sched.c index b8ed8ae3f8..318ec44b73 100644 --- a/fftools/ffmpeg_sched.c +++ b/fftools/ffmpeg_sched.c @@ -285,8 +285,8 @@ struct Scheduler { pthread_mutex_t mux_ready_lock; unsigned nb_mux_done; - pthread_mutex_t mux_done_lock; - pthread_cond_t mux_done_cond; + pthread_mutex_t finish_lock; + pthread_cond_t finish_cond; SchDec *dec; @@ -571,8 +571,8 @@ void sch_free(Scheduler **psch) pthread_mutex_destroy(&sch->mux_ready_lock); - pthread_mutex_destroy(&sch->mux_done_lock); - pthread_cond_destroy(&sch->mux_done_cond); + pthread_mutex_destroy(&sch->finish_lock); + pthread_cond_destroy(&sch->finish_cond); av_freep(psch); } @@ -602,11 +602,11 @@ Scheduler *sch_alloc(void) if (ret) goto fail; - ret = pthread_mutex_init(&sch->mux_done_lock, NULL); + ret = pthread_mutex_init(&sch->finish_lock, NULL); if (ret) goto fail; - ret = pthread_cond_init(&sch->mux_done_cond, NULL); + ret = pthread_cond_init(&sch->finish_cond, NULL); if (ret) goto fail; @@ -1669,17 +1669,17 @@ int sch_wait(Scheduler *sch, uint64_t timeout_us, int64_t *transcode_ts) // convert delay to absolute timestamp timeout_us += av_gettime(); - pthread_mutex_lock(&sch->mux_done_lock); + pthread_mutex_lock(&sch->finish_lock); if (sch->nb_mux_done < sch->nb_mux) { struct timespec tv = { .tv_sec = timeout_us / 1000000, .tv_nsec = (timeout_us % 1000000) * 1000 }; - pthread_cond_timedwait(&sch->mux_done_cond, &sch->mux_done_lock, &tv); + pthread_cond_timedwait(&sch->finish_cond, &sch->finish_lock, &tv); } ret = sch->nb_mux_done == sch->nb_mux; - pthread_mutex_unlock(&sch->mux_done_lock); + pthread_mutex_unlock(&sch->finish_lock); *transcode_ts = atomic_load(&sch->last_dts); @@ -2152,14 +2152,14 @@ static int mux_done(Scheduler *sch, unsigned mux_idx) pthread_mutex_unlock(&sch->schedule_lock); - pthread_mutex_lock(&sch->mux_done_lock); + pthread_mutex_lock(&sch->finish_lock); av_assert0(sch->nb_mux_done < sch->nb_mux); sch->nb_mux_done++; - pthread_cond_signal(&sch->mux_done_cond); + pthread_cond_signal(&sch->finish_cond); - pthread_mutex_unlock(&sch->mux_done_lock); + pthread_mutex_unlock(&sch->finish_lock); return 0; } |