Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions tests/unit/test_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,27 @@ void test_mp4_faststart_concurrent_reads_copies_and_saves(void) {
int save_result = 0;
int valid_saves = 0;
bool streams_distinct_ok = true;
while (atomic_load(&faststart_writer_updates) == 0) {
bool writer_progress_ok = true;
struct timespec initial_wait_start = {0};
if (clock_gettime(CLOCK_MONOTONIC, &initial_wait_start) != 0) {
writer_progress_ok = false;
}
while (writer_progress_ok && atomic_load(&faststart_writer_updates) == 0) {
struct timespec now = {0};
if (clock_gettime(CLOCK_MONOTONIC, &now) != 0) {
writer_progress_ok = false;
break;
}
long elapsed_ms =
(now.tv_sec - initial_wait_start.tv_sec) * 1000L +
(now.tv_nsec - initial_wait_start.tv_nsec) / 1000000L;
if (elapsed_ms > 2000L) {
writer_progress_ok = false;
break;
}
sched_yield();
}
bool writer_progress_ok = true;
for (int i = 0; i < 50; ++i) {
for (int i = 0; i < 50 && writer_progress_ok; ++i) {
(void)config_get_mp4_faststart(&cfg);
config_t snapshot = {0};
if (!config_copy(&snapshot, &cfg)) streams_distinct_ok = false;
Expand Down
Loading