mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-18 13:24:40 +00:00
Stop the video buffer on error
If an error occurs from the video buffer thread (typically an out-of-memory error), then stop.
This commit is contained in:
parent
a3703340fc
commit
ad94ccca0b
@ -93,9 +93,16 @@ run_buffering(void *data) {
|
||||
pts, vb_frame.push_date, sc_tick_now());
|
||||
#endif
|
||||
|
||||
sc_video_buffer_offer(vb, vb_frame.frame);
|
||||
|
||||
bool ok = sc_video_buffer_offer(vb, vb_frame.frame);
|
||||
sc_video_buffer_frame_destroy(&vb_frame);
|
||||
if (!ok) {
|
||||
LOGE("Delayed frame could not be pushed, stopping");
|
||||
sc_mutex_lock(&vb->b.mutex);
|
||||
// Prevent to push any new packet
|
||||
vb->b.stopped = true;
|
||||
sc_mutex_unlock(&vb->b.mutex);
|
||||
goto stopped;
|
||||
}
|
||||
}
|
||||
|
||||
stopped:
|
||||
|
Loading…
Reference in New Issue
Block a user