Browse Source

add some logic to cope with slow startup times.

tags/v1.9.4
Torben Hohn 16 years ago
parent
commit
888988823d
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      common/netjack.c

+ 15
- 1
common/netjack.c View File

@@ -97,7 +97,21 @@ int netjack_wait( netjack_driver_state_t *netj )


// Increment expected frame here. // Increment expected frame here.


netj->expected_framecnt += 1;
if( netj->expected_framecnt_valid ) {
netj->expected_framecnt += 1;
} else {
// starting up.... lets look into the packetcache, and fetch the highest packet.
packet_cache_drain_socket( global_packcache, netj->sockfd );
if( packet_cache_get_highest_available_framecnt( global_packcache, &next_frame_avail ) ) {
netj->expected_framecnt = next_frame_avail;
netj->expected_framecnt_valid = 1;
} else {
// no packets there... start normally.
netj->expected_framecnt = 0;
netj->expected_framecnt_valid = 1;
}

}


//jack_log( "expect %d", netj->expected_framecnt ); //jack_log( "expect %d", netj->expected_framecnt );
// Now check if required packet is already in the cache. // Now check if required packet is already in the cache.


Loading…
Cancel
Save