Changeset fa60cd69 in mainline for uspace/srv/audio/hound/audio_sink.c
- Timestamp:
- 2013-04-02T19:06:27Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 35ab943
- Parents:
- 39c4d1f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_sink.c
r39c4d1f rfa60cd69 41 41 42 42 #include "audio_sink.h" 43 #include "connection.h" 43 44 #include "log.h" 44 45 … … 54 55 } 55 56 link_initialize(&sink->link); 56 list_initialize(&sink-> sources);57 list_initialize(&sink->connections); 57 58 sink->name = str_dup(name); 58 59 sink->private_data = private_data; … … 67 68 { 68 69 assert(sink); 70 assert(list_empty(&sink->connections)); 69 71 assert(!sink->private_data); 70 72 free(sink->name); … … 72 74 } 73 75 76 #if 0 74 77 int audio_sink_add_source(audio_sink_t *sink, audio_source_t *source) 75 78 { … … 92 95 93 96 audio_source_connected(source, sink); 94 95 97 if (sink->connection_change) { 96 98 log_verbose("Calling connection change"); … … 98 100 if (ret != EOK) { 99 101 log_debug("Connection hook failed."); 100 audio_source_connected(source, NULL);101 list_remove(&source->link);102 sink->format = old_format;102 // audio_source_connected(source, NULL); 103 // list_remove(&source->link); 104 // sink->format = old_format; 103 105 return ret; 104 106 } … … 109 111 return EOK; 110 112 } 113 #endif 111 114 112 115 int audio_sink_set_format(audio_sink_t *sink, const pcm_format_t *format) … … 118 121 return EEXISTS; 119 122 } 120 const pcm_format_t old_format ;123 const pcm_format_t old_format = sink->format; 121 124 122 125 if (pcm_format_is_any(format)) { … … 140 143 } 141 144 145 #if 0 142 146 int audio_sink_remove_source(audio_sink_t *sink, audio_source_t *source) 143 147 { … … 157 161 return EOK; 158 162 } 163 #endif 159 164 160 165 … … 165 170 166 171 pcm_format_silence(dest, size, &sink->format); 167 list_foreach(sink-> sources, it) {168 audio_source_t *source = audio_source_list_instance(it);169 const int ret = 170 audio_source_add_self(source, dest, size, &sink->format);172 list_foreach(sink->connections, it) { 173 connection_t * conn = connection_from_sink_list(it); 174 const int ret = connection_add_source_data( 175 conn, dest, size, sink->format); 171 176 if (ret != EOK) { 172 log_warning("Failed to mixsource %s: %s",173 source->name, str_error(ret));177 log_warning("Failed to add source %s: %s", 178 connection_source_name(conn), str_error(ret)); 174 179 } 175 180 }
Note:
See TracChangeset
for help on using the changeset viewer.