# HG changeset patch # User Eric Wing # Date 1317321214 25200 # Node ID 9b772c81b550a0f0dbf2fd5a68b98a39445266ed # Parent 56855942fdc63cbaa874897ad41f5f43659fb315 Added addition query to get the current number of buffers processed in the new inner buffer decoupling loop because I've been seeing a lot of 59TestingError warnings. I think it is possible the value may become stale after the first iteration of the loop resulting in assumption failures which result in triggering this error. Also changed some // comments to /* */ for C89 compliance. diff -r 56855942fdc6 -r 9b772c81b550 ALmixer.c --- a/ALmixer.c Tue Sep 13 18:03:21 2011 -0700 +++ b/ALmixer.c Thu Sep 29 11:33:34 2011 -0700 @@ -2689,7 +2689,7 @@ ALuint queue_ret_flag; for(k=0; knum_buffers_in_use; k++) { -// fprintf(stderr, "56c: CircularQueue_PushBack.\n"); +/* fprintf(stderr, "56c: CircularQueue_PushBack.\n"); */ queue_ret_flag = CircularQueueUnsignedInt_PushBack(data->circular_buffer_queue, data->buffer[k]); if(0 == queue_ret_flag) { @@ -5276,7 +5276,7 @@ /* WARNING: It looks like Snow Leopard some times crashes on this call under x86_64 * typically when I suffer a lot of buffer underruns. */ -// fprintf(stderr, "calling AL_BUFFERS_PROCESSED on source:%d", ALmixer_Channel_List[i].alsource); +/* fprintf(stderr, "calling AL_BUFFERS_PROCESSED on source:%d", ALmixer_Channel_List[i].alsource); */ alGetSourcei( ALmixer_Channel_List[i].alsource, AL_BUFFERS_PROCESSED, &buffers_processed @@ -5286,7 +5286,7 @@ fprintf(stderr, "52Testing error: %s\n", alGetString(error)); } -// fprintf(stderr, "finished AL_BUFFERS_PROCESSED, buffers_processed=%d", buffers_processed); +/* fprintf(stderr, "finished AL_BUFFERS_PROCESSED, buffers_processed=%d", buffers_processed); */ /* WTF!!! The Nvidia distribution is failing on the alGetSourcei(source, AL_BUFFER, buf_id) call. * I need this call to figure out which buffer OpenAL is currently playing. @@ -5483,7 +5483,7 @@ if(AL_STOPPED == state) { number_of_buffers_to_queue_this_pass = ALmixer_Channel_List[i].almixer_data->num_startup_buffers; -// fprintf(stderr, "assuming underrun condition, using num_startup_buffers=%d\n", number_of_buffers_to_queue_this_pass); +/* fprintf(stderr, "assuming underrun condition, using num_startup_buffers=%d\n", number_of_buffers_to_queue_this_pass); */ } /* Don't bother to check to make sure the number_of_buffers_to_queue_this_pass does not exceed the maximum number of buffers because of the logic hack bug. */ @@ -5497,7 +5497,25 @@ } for(current_count_of_buffer_queue_passes=0; current_count_of_buffer_queue_passescircular_buffer_queue != NULL) { ALuint queue_ret_flag; - // fprintf(stderr, "56d: CircularQueue_PushBack.\n"); + /* fprintf(stderr, "56d: CircularQueue_PushBack.\n"); */ queue_ret_flag = CircularQueueUnsignedInt_PushBack( ALmixer_Channel_List[i].almixer_data->circular_buffer_queue, ALmixer_Channel_List[i].almixer_data->buffer[ALmixer_Channel_List[i].almixer_data->num_buffers_in_use] @@ -5966,7 +5984,7 @@ if(ALmixer_Channel_List[i].almixer_data->circular_buffer_queue != NULL) { ALuint queue_ret_flag; - // fprintf(stderr, "56e: CircularQueue_PushBack.\n"); + /* fprintf(stderr, "56e: CircularQueue_PushBack.\n"); */ queue_ret_flag = CircularQueueUnsignedInt_PushBack( ALmixer_Channel_List[i].almixer_data->circular_buffer_queue, unqueued_buffer_id @@ -7737,7 +7755,7 @@ } va_list argp; va_start(argp, err_str); - // SDL_SetError which I'm emulating has no number parameter. + /* SDL_SetError which I'm emulating has no number parameter. */ TError_SetErrorv(s_ALmixerErrorPool, 1, err_str, argp); va_end(argp); } @@ -8268,7 +8286,7 @@ free(ret_data->buffer_map_list[j].data); j--; } - // Delete for j=0 because the while loop misses the last one + /* Delete for j=0 because the while loop misses the last one */ free(ret_data->buffer_map_list[j].data); free(ret_data->buffer_map_list);