mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 03:25:03 +00:00
Fix recorder waiting when stream disabled
In the recorder, if the video or audio stream is disabled, do not wait for its initialization (it will never happen) to process the header. In that case (scrcpy --no-audio --record=file.mp4), this caused the whole content to be buffered in memory, and written only on exit.
This commit is contained in:
parent
379caf8551
commit
9d3c656414
1 changed files with 4 additions and 3 deletions
|
@ -178,9 +178,10 @@ static bool
|
|||
sc_recorder_process_header(struct sc_recorder *recorder) {
|
||||
sc_mutex_lock(&recorder->mutex);
|
||||
|
||||
while (!recorder->stopped && (!recorder->video_init
|
||||
|| !recorder->audio_init
|
||||
|| sc_recorder_has_empty_queues(recorder))) {
|
||||
while (!recorder->stopped &&
|
||||
((recorder->video && !recorder->video_init)
|
||||
|| (recorder->audio && !recorder->audio_init)
|
||||
|| sc_recorder_has_empty_queues(recorder))) {
|
||||
sc_cond_wait(&recorder->cond, &recorder->mutex);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue