[xiph-commits] r3695 - browser_plugin/trunk/src/audio
j at svn.annodex.net
j at svn.annodex.net
Fri Aug 8 11:01:15 PDT 2008
Author: j
Date: 2008-08-08 11:01:14 -0700 (Fri, 08 Aug 2008)
New Revision: 3695
Modified:
browser_plugin/trunk/src/audio/sydney_audio_alsa.c
Log:
replace tabs with spaces
Modified: browser_plugin/trunk/src/audio/sydney_audio_alsa.c
===================================================================
--- browser_plugin/trunk/src/audio/sydney_audio_alsa.c 2008-08-05 14:30:09 UTC (rev 3694)
+++ browser_plugin/trunk/src/audio/sydney_audio_alsa.c 2008-08-08 18:01:14 UTC (rev 3695)
@@ -177,19 +177,19 @@
}
if (snd_pcm_open(&s->output_unit,
- "default",
- SND_PCM_STREAM_PLAYBACK,
- 0) < 0) {
+ "default",
+ SND_PCM_STREAM_PLAYBACK,
+ 0) < 0) {
return SA_ERROR_NO_DEVICE;
}
if (snd_pcm_set_params(s->output_unit,
- SND_PCM_FORMAT_S16_LE,
- SND_PCM_ACCESS_RW_INTERLEAVED,
- s->n_channels,
- s->rate,
- 1,
- 0) < 0) {
+ SND_PCM_FORMAT_S16_LE,
+ SND_PCM_ACCESS_RW_INTERLEAVED,
+ s->n_channels,
+ s->rate,
+ 1,
+ 0) < 0) {
snd_pcm_close(s->output_unit);
s->output_unit = NULL;
return SA_ERROR_NOT_SUPPORTED;
@@ -367,13 +367,13 @@
buffer = malloc(period_size * bytes_per_frame);
while(1) {
- char* dst = buffer;
- unsigned int bytes_to_copy = period_size * bytes_per_frame;
- snd_pcm_sframes_t frames;
+ char* dst = buffer;
+ unsigned int bytes_to_copy = period_size * bytes_per_frame;
+ snd_pcm_sframes_t frames;
- pthread_mutex_lock(&s->mutex);
- if (!s->thread_id)
- break;
+ pthread_mutex_lock(&s->mutex);
+ if (!s->thread_id)
+ break;
/*
* Consume data from the start of the buffer list.
@@ -383,42 +383,42 @@
assert(s->bl_head->start <= s->bl_head->end);
if (avail >= bytes_to_copy) {
- /*
- * We have all we need in the head buffer, so just grab it and go.
- */
- memcpy(dst, s->bl_head->data + s->bl_head->start, bytes_to_copy);
- s->bl_head->start += bytes_to_copy;
- s->bytes_played += bytes_to_copy;
- break;
-
+ /*
+ * We have all we need in the head buffer, so just grab it and go.
+ */
+ memcpy(dst, s->bl_head->data + s->bl_head->start, bytes_to_copy);
+ s->bl_head->start += bytes_to_copy;
+ s->bytes_played += bytes_to_copy;
+ break;
+
} else {
- sa_buf* next = 0;
- /*
- * Copy what we can from the head and move on to the next buffer.
- */
- memcpy(dst, s->bl_head->data + s->bl_head->start, avail);
- s->bl_head->start += avail;
- dst += avail;
- bytes_to_copy -= avail;
- s->bytes_played += avail;
+ sa_buf* next = 0;
+ /*
+ * Copy what we can from the head and move on to the next buffer.
+ */
+ memcpy(dst, s->bl_head->data + s->bl_head->start, avail);
+ s->bl_head->start += avail;
+ dst += avail;
+ bytes_to_copy -= avail;
+ s->bytes_played += avail;
- /*
- * We want to free the now-empty buffer, but not if it's also the
- * current tail. If it is the tail, we don't have enough data to fill
- * the destination buffer, so we'll just zero it out and give up.
- */
- next = s->bl_head->next;
- if (next == NULL) {
+ /*
+ * We want to free the now-empty buffer, but not if it's also the
+ * current tail. If it is the tail, we don't have enough data to fill
+ * the destination buffer, so we'll just zero it out and give up.
+ */
+ next = s->bl_head->next;
+ if (next == NULL) {
#ifdef TIMING_TRACE
- printf("!"); /* not enough audio data */
+ printf("!"); /* not enough audio data */
#endif
- memset(dst, 0, bytes_to_copy);
- break;
- }
- free(s->bl_head);
- s->bl_head = next;
- s->n_bufs--;
-
+ memset(dst, 0, bytes_to_copy);
+ break;
+ }
+ free(s->bl_head);
+ s->bl_head = next;
+ s->n_bufs--;
+
} /* if (avail >= bytes_to_copy), else */
} /* while (1) */
@@ -429,10 +429,10 @@
if (frames < 0) {
frames = snd_pcm_recover(s->output_unit, frames, 1);
if (frames < 0) {
- printf("snc_pcm_recover error: %s\n", snd_strerror(frames));
+ printf("snc_pcm_recover error: %s\n", snd_strerror(frames));
}
if(frames > 0 && frames < period_size)
- printf("short write (expected %d, wrote %d)\n", (int)period_size, (int)frames);;
+ printf("short write (expected %d, wrote %d)\n", (int)period_size, (int)frames);;
}
}
free(buffer);
More information about the commits
mailing list