Clean up code in audio-io.c

Clean up a little bit of code that was unnecessarily nested.  Still a
little squishy but better than it was.
This commit is contained in:
jp9000 2014-01-10 19:21:32 -07:00
parent 4aa4858ac7
commit 3f0b352d7f

View File

@ -450,20 +450,18 @@ void audio_line_output(audio_line_t line, const struct audio_data *data)
if (!line->buffer.size) {
line->base_timestamp = data->timestamp;
audio_line_place_data_pos(line, data, 0);
} else {
if (line->base_timestamp <= data->timestamp)
audio_line_place_data(line, data);
else
blog(LOG_DEBUG, "Bad timestamp for audio line '%s', "
"data->timestamp: %llu, "
"line->base_timestamp: %llu. "
"This can sometimes happen when "
"there's a pause in the threads.",
line->name, data->timestamp,
line->base_timestamp);
} else if (line->base_timestamp <= data->timestamp) {
audio_line_place_data(line, data);
} else {
blog(LOG_DEBUG, "Bad timestamp for audio line '%s', "
"data->timestamp: %llu, "
"line->base_timestamp: %llu. This can "
"sometimes happen when there's a pause in "
"the threads.", line->name, data->timestamp,
line->base_timestamp);
}
pthread_mutex_unlock(&line->mutex);