Add mutex assertions

This commit is contained in:
Romain Vimont 2021-01-31 18:56:50 +01:00
parent 21d206f360
commit 54f5c42d7b

View file

@ -64,6 +64,7 @@ video_buffer_destroy(struct video_buffer *vb) {
static void static void
video_buffer_swap_frames(struct video_buffer *vb) { video_buffer_swap_frames(struct video_buffer *vb) {
sc_mutex_assert(&vb->mutex);
AVFrame *tmp = vb->decoding_frame; AVFrame *tmp = vb->decoding_frame;
vb->decoding_frame = vb->rendering_frame; vb->decoding_frame = vb->rendering_frame;
vb->rendering_frame = tmp; vb->rendering_frame = tmp;
@ -92,6 +93,7 @@ video_buffer_offer_decoded_frame(struct video_buffer *vb,
const AVFrame * const AVFrame *
video_buffer_consume_rendered_frame(struct video_buffer *vb) { video_buffer_consume_rendered_frame(struct video_buffer *vb) {
sc_mutex_assert(&vb->mutex);
assert(!vb->rendering_frame_consumed); assert(!vb->rendering_frame_consumed);
vb->rendering_frame_consumed = true; vb->rendering_frame_consumed = true;
fps_counter_add_rendered_frame(vb->fps_counter); fps_counter_add_rendered_frame(vb->fps_counter);