Changeset 5169:be6f5ef02fc3 in roaraudio
- Timestamp:
- 10/18/11 15:26:39 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/alsa/thread.c
r5157 r5169 44 44 // Writes to the FIFO buffer. Waits until there is room to write. 45 45 size_t roar_plugin_write(struct roar_alsa_pcm *self, const char *buf, size_t size) { 46 ROAR_DBG("roar_plugin_write(self=%p, buf=%p, size=%llu) = ?", self, buf, (long long unsigned int)size); 47 46 48 /* Wait until we have a ready buffer */ 47 49 while (1) { … … 83 85 // Attemps to drain the buffer at all times and write to libroar. 84 86 // If there is no data, it will wait for roar_plugin_write() to fill up more data. 85 void * roar_plugin_thread (void * thread_data) {87 void * roar_plugin_thread (void * thread_data) { 86 88 /* We share data between thread and callable functions */ 87 89 struct roar_alsa_pcm *self = thread_data; … … 91 93 /* Two loops! :3 Beware! */ 92 94 while(1) { 95 ROAR_DBG("roar_plugin_thread(thread_data=%p): got woken up.", thread_data); 93 96 while(1) { 94 97 _TEST_CANCEL(); … … 104 107 pthread_mutex_unlock(&(self->lock)); 105 108 109 ROAR_DBG("roar_plugin_thread(thread_data=%p): Start writing.", thread_data); 106 110 rc = roar_vio_write(&(self->stream_vio), self->buffer, CHUNK_SIZE); 111 ROAR_DBG("roar_plugin_thread(thread_data=%p): wrote %lli bytes.", thread_data, (long long int)rc); 107 112 108 113 /* If this happens, we should make sure that subsequent and current calls to rsd_write() will fail. */
Note: See TracChangeset
for help on using the changeset viewer.