Changeset fa60cd69 in mainline for uspace/srv/audio/hound/audio_device.c
- Timestamp:
- 2013-04-02T19:06:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 35ab943
- Parents:
- 39c4d1f
- File:
-
- 1 edited
-
uspace/srv/audio/hound/audio_device.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_device.c
r39c4d1f rfa60cd69 49 49 50 50 static int device_sink_connection_callback(audio_sink_t *sink, bool new); 51 static int device_source_connection_callback(audio_source_t *source );51 static int device_source_connection_callback(audio_source_t *source, bool new); 52 52 static void device_event_callback(ipc_callid_t iid, ipc_call_t *icall, void *arg); 53 53 static int device_check_format(audio_sink_t* sink); … … 94 94 assert(sink); 95 95 audio_device_t *dev = sink->private_data; 96 if (new && list_count(&sink-> sources) == 1) {96 if (new && list_count(&sink->connections) == 1) { 97 97 log_verbose("First connection on device sink '%s'", sink->name); 98 98 … … 104 104 } 105 105 audio_pcm_register_event_callback(dev->sess, 106 device_event_callback, dev); 106 device_event_callback, dev);\ 107 // TODO set formats 107 108 108 109 /* Fill the buffer first */ … … 110 111 dev->buffer.base, dev->buffer.size); 111 112 113 log_verbose("Mixed inputs: %zu/(%u * %u)", 114 dev->buffer.size, BUFFER_PARTS, pcm_format_frame_size(&dev->sink.format)); 112 115 const unsigned frames = dev->buffer.size / 113 116 (BUFFER_PARTS * pcm_format_frame_size(&dev->sink.format)); 117 log_verbose("FRAME COUNT %u", frames); 114 118 ret = audio_pcm_start_playback_fragment(dev->sess, frames, 115 119 dev->sink.format.channels, dev->sink.format.sampling_rate, … … 122 126 } 123 127 } 124 if (list_count(&sink-> sources) == 0) {128 if (list_count(&sink->connections) == 0) { 125 129 assert(!new); 126 130 log_verbose("No connections on device sink '%s'", sink->name); … … 142 146 } 143 147 144 static int device_source_connection_callback(audio_source_t *source )148 static int device_source_connection_callback(audio_source_t *source, bool new) 145 149 { 146 150 assert(source); 147 151 audio_device_t *dev = source->private_data; 148 if ( source->connected_sink) {152 if (new && list_count(&source->connections)) { 149 153 int ret = get_buffer(dev); 150 154 if (ret != EOK) { … … 164 168 return ret; 165 169 } 166 } else { /* Disconnected */ 170 } 171 if (list_count(&source->connections) == 0) { /* Disconnected */ 172 assert(!new); 167 173 int ret = audio_pcm_stop_capture(dev->sess); 168 174 if (ret != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.
