Changeset 3458


Ignore:
Timestamp:
May 14, 2009, 6:27:17 PM (11 years ago)
Author:
Pascal Terjan
Message:
  • First try at limiting refresh rate on server side, should rather be done earlier to not uselessly blit and dither
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/server.c

    r3457 r3458  
    9999    size_t bytes;
    100100    void *buf;
     101    static struct timeval last_refresh = {0, 0}; /* FIXME store it at the right place */
     102    struct timeval t;
     103
     104    gettimeofday(&t, NULL);
     105   
     106    if((t.tv_sec-last_refresh.tv_sec)*1000 +
     107       (t.tv_usec-last_refresh.tv_usec)/1000
     108       < screen_list->delay)
     109        return 0;
     110    last_refresh.tv_sec = t.tv_sec;
     111    last_refresh.tv_usec = t.tv_usec;
     112
    101113    buf = caca_export_memory (screen_list->cv, "caca", &bytes);
    102114    if(!screen_list->socket[SOCK_CLIENT])
Note: See TracChangeset for help on using the changeset viewer.