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
1 changed files with 9 additions and 2 deletions
|
@ -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 a new issue