Changeset 4166:cde6dd3edef8 in roaraudio for plugins/alsa


Ignore:
Timestamp:
08/14/10 00:05:46 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated to conform RA's coding style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/alsa/thread.c

    r4165 r4166  
    4343size_t roar_write(struct roar_alsa_pcm *self, const char *buf, size_t size) { 
    4444 /* Wait until we have a ready buffer */ 
    45  for (;;) { 
     45 while (1) { 
    4646  /* Should the thread be shut down while we're running, return with error */ 
    4747  if ( !self->thread_active ) 
     
    156156 
    157157void roar_drain(struct roar_alsa_pcm *self) { 
     158 struct timespec now_tv; 
     159 int64_t temp, temp2; 
     160 
    158161 /* If the audio playback has started on the server we need to use timers. */ 
    159162 if ( self->has_written ) { 
    160   int64_t temp, temp2; 
    161163 
    162164  /* Falls back to gettimeofday() when CLOCK_MONOTONIC is not supported */ 
    163165 
    164166  /* Calculates the amount of bytes that the server has consumed. */ 
    165   struct timespec now_tv; 
    166167  clock_gettime(CLOCK_MONOTONIC, &now_tv); 
    167168 
    168   temp = (int64_t)now_tv.tv_sec - (int64_t)self->start_tv.tv_sec; 
     169  temp   = (int64_t)now_tv.tv_sec - (int64_t)self->start_tv.tv_sec; 
    169170 
    170   temp *= self->info.rate * self->info.channels * self->info.bits / 8; 
     171  temp  *= self->info.rate * self->info.channels * self->info.bits / 8; 
    171172 
    172   temp2 = (int64_t)now_tv.tv_nsec - (int64_t)self->start_tv.tv_nsec; 
     173  temp2  = (int64_t)now_tv.tv_nsec - (int64_t)self->start_tv.tv_nsec; 
    173174  temp2 *= self->info.rate * self->info.channels * self->info.bits / 8; 
    174   temp2 /= 1000000000; 
    175   temp += temp2; 
     175  temp2 /= 1000000000LL; 
     176  temp  += temp2; 
    176177  /* Calculates the amount of data we have in our virtual buffer. Only used to calculate delay. */ 
    177178  self->bytes_in_buffer = (int)((int64_t)self->total_written + (int64_t)self->bufptr - temp); 
     
    181182} 
    182183 
    183  
    184  
     184//ll 
Note: See TracChangeset for help on using the changeset viewer.