diff options
| author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-22 12:50:41 +0000 | 
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-08-22 12:50:41 +0000 | 
| commit | 8dfa81ccf2c3eeb7518958428524a9850be1fd3d (patch) | |
| tree | 6c46b77c6adf5c94c9d9db9c9e7b6852778c7f97 | |
| parent | f883b95e5ca06f863a75a1e2b4d2ec071bb30112 (diff) | |
Make the uint boundary check a little bit more reliable
| -rw-r--r-- | audio/pcm_bluetooth.c | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c index 2748c8f4..d5f89143 100644 --- a/audio/pcm_bluetooth.c +++ b/audio/pcm_bluetooth.c @@ -162,19 +162,18 @@ static void *a2dp_playback_hw_thread(void *param)  							data->io.period_size;  			data->hw_ptr %= data->io.buffer_size; -			DBG("pointer=%ld", data->hw_ptr); -  			/* Notify user that hardware pointer has moved */  			if (write(data->a2dp.pipefd[1], &c, 1) < 0)  				pthread_testcancel();  			/* Reset point of reference to avoid too big values  			 * that wont fit an unsigned int */ -			if (delta.tv_sec > UINT_SECS_MAX) { +			if (delta.tv_sec < UINT_SECS_MAX) +				prev_periods = periods; +			else {  				prev_periods = 0;  				gettimeofday(&start, 0); -			} else -				prev_periods = periods; +			}  		}  iter_sleep: | 
