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:
Romain Vimont 2023-03-01 18:33:03 +01:00
parent a3703340fc
commit ad94ccca0b

View file

@ -93,9 +93,16 @@ run_buffering(void *data) {
pts, vb_frame.push_date, sc_tick_now()); pts, vb_frame.push_date, sc_tick_now());
#endif #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); 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: stopped: