Use a single condvar in recorder

The sc_cond_wait() in sc_recorder_process_header() needs to be notified
of changes to video_init/audio_init (protected by stream_cond) and
video_queue/audio_queue (protected by queue_cond).

Use only one condition variable to simplify.
This commit is contained in:
Romain Vimont
2023-06-03 15:05:23 +02:00
parent 2aec7b4c9d
commit 379caf8551
2 changed files with 13 additions and 23 deletions

View File

@@ -35,14 +35,13 @@ struct sc_recorder {
sc_thread thread;
sc_mutex mutex;
sc_cond queue_cond;
sc_cond cond;
// set on sc_recorder_stop(), packet_sink close or recording failure
bool stopped;
struct sc_recorder_queue video_queue;
struct sc_recorder_queue audio_queue;
// wake up the recorder thread once the video or audio codec is known
sc_cond stream_cond;
bool video_init;
bool audio_init;