History

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.

Anton Khirnov committed 1 year ago

Commit 785ffe61 parent 224b6241 file · +12 −12Browse files

Unified · Split

fftools/ffmpeg_sched.c+12−12
@@ -285,8 +285,8 @@ struct Scheduler { · 284 unmodified lines
285285 pthread_mutex_t mux_ready_lock;
286286
287287 unsigned nb_mux_done;
288− pthread_mutex_t mux_done_lock;
289− pthread_cond_t mux_done_cond;
288+ pthread_mutex_t finish_lock;
289+ pthread_cond_t finish_cond;
290290
291291
292292 SchDec *dec;
@@ -571,8 +571,8 @@ void sch_free(Scheduler **psch) · 278 unmodified lines
571571
572572 pthread_mutex_destroy(&sch->mux_ready_lock);
573573
574− pthread_mutex_destroy(&sch->mux_done_lock);
575− pthread_cond_destroy(&sch->mux_done_cond);
574+ pthread_mutex_destroy(&sch->finish_lock);
575+ pthread_cond_destroy(&sch->finish_cond);
576576
577577 av_freep(psch);
578578 }
@@ -602,11 +602,11 @@ Scheduler *sch_alloc(void) · 23 unmodified lines
602602 if (ret)
603603 goto fail;
604604
605− ret = pthread_mutex_init(&sch->mux_done_lock, NULL);
605+ ret = pthread_mutex_init(&sch->finish_lock, NULL);
606606 if (ret)
607607 goto fail;
608608
609− ret = pthread_cond_init(&sch->mux_done_cond, NULL);
609+ ret = pthread_cond_init(&sch->finish_cond, NULL);
610610 if (ret)
611611 goto fail;
612612
@@ -1669,17 +1669,17 @@ int sch_wait(Scheduler *sch, uint64_t timeout_us, int64_t *transcode_ts) · 1056 unmodified lines
16691669 // convert delay to absolute timestamp
16701670 timeout_us += av_gettime();
16711671
1672− pthread_mutex_lock(&sch->mux_done_lock);
1672+ pthread_mutex_lock(&sch->finish_lock);
16731673
16741674 if (sch->nb_mux_done < sch->nb_mux) {
16751675 struct timespec tv = { .tv_sec = timeout_us / 1000000,
16761676 .tv_nsec = (timeout_us % 1000000) * 1000 };
1677− pthread_cond_timedwait(&sch->mux_done_cond, &sch->mux_done_lock, &tv);
1677+ pthread_cond_timedwait(&sch->finish_cond, &sch->finish_lock, &tv);
16781678 }
16791679
16801680 ret = sch->nb_mux_done == sch->nb_mux;
16811681
1682− pthread_mutex_unlock(&sch->mux_done_lock);
1682+ pthread_mutex_unlock(&sch->finish_lock);
16831683
16841684 *transcode_ts = atomic_load(&sch->last_dts);
16851685
@@ -2152,14 +2152,14 @@ static int mux_done(Scheduler *sch, unsigned mux_idx) · 466 unmodified lines
21522152
21532153 pthread_mutex_unlock(&sch->schedule_lock);
21542154
2155− pthread_mutex_lock(&sch->mux_done_lock);
2155+ pthread_mutex_lock(&sch->finish_lock);
21562156
21572157 av_assert0(sch->nb_mux_done < sch->nb_mux);
21582158 sch->nb_mux_done++;
21592159
2160− pthread_cond_signal(&sch->mux_done_cond);
2160+ pthread_cond_signal(&sch->finish_cond);
21612161
2162− pthread_mutex_unlock(&sch->mux_done_lock);
2162+ pthread_mutex_unlock(&sch->finish_lock);
21632163
21642164 return 0;
21652165 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t