From: Steinar H. Gunderson Date: Sat, 2 Apr 2016 23:18:01 +0000 (+0200) Subject: Add a warning if we should start allocating more surfaces for the H.264 encoder. X-Git-Tag: 1.2.0~21 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4e21ff10a3229bcab10fd0f3f201d7502ee660bf;p=nageru Add a warning if we should start allocating more surfaces for the H.264 encoder. --- diff --git a/h264encode.cpp b/h264encode.cpp index 913c888..d826496 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -1725,6 +1725,10 @@ bool H264EncoderImpl::begin_frame(GLuint *y_tex, GLuint *cbcr_tex) { // Wait until this frame slot is done encoding. unique_lock lock(storage_task_queue_mutex); + if (srcsurface_status[current_storage_frame % SURFACE_NUM] != SRC_SURFACE_FREE) { + fprintf(stderr, "Warning: Slot %d (for frame %d) is still encoding, rendering has to wait for H.264 encoder\n", + current_storage_frame % SURFACE_NUM, current_storage_frame); + } storage_task_queue_changed.wait(lock, [this]{ return storage_thread_should_quit || (srcsurface_status[current_storage_frame % SURFACE_NUM] == SRC_SURFACE_FREE); }); if (storage_thread_should_quit) return false; }