void QueueLengthPolicy::update_policy(int queue_length)
{
if (queue_length < 0) { // Starvation.
- if (safe_queue_length < 5) {
+ if (been_at_safe_point_since_last_starvation && safe_queue_length < 5) {
++safe_queue_length;
fprintf(stderr, "Card %u: Starvation, increasing safe limit to %u frames\n",
card_index, safe_queue_length);
}
frames_with_at_least_one = 0;
+ been_at_safe_point_since_last_starvation = false;
return;
}
if (queue_length > 0) {
+ if (queue_length >= int(safe_queue_length)) {
+ been_at_safe_point_since_last_starvation = true;
+ }
if (++frames_with_at_least_one >= 50 && safe_queue_length > 0) {
--safe_queue_length;
fprintf(stderr, "Card %u: Spare frames for more than 50 frames, reducing safe limit to %u frames\n",
GLuint pbo = userdata->pbo;
check_error();
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
check_error();
glFlushMappedBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, video_frame.size);
check_error();
check_error();
glBindTexture(GL_TEXTURE_2D, 0);
check_error();
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
check_error();
RefCountedGLsync fence(GL_SYNC_GPU_COMMANDS_COMPLETE, /*flags=*/0);
check_error();