Changeset 50179b63 in mainline
- Timestamp:
- 2013-04-05T12:23:58Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c5b8548
- Parents:
- f1438e5
- Location:
- uspace/srv/audio/hound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/connection.c
rf1438e5 r50179b63 46 46 connection_t *conn = malloc(sizeof(connection_t)); 47 47 if (conn) { 48 list_initialize(&conn->fifo);48 audio_pipe_init(&conn->fifo); 49 49 link_initialize(&conn->source_link); 50 50 link_initialize(&conn->sink_link); … … 74 74 if (connection->source && connection->source->connection_change) 75 75 connection->source->connection_change(connection->source, false); 76 while (!list_empty(&connection->fifo)) { 77 link_t *l = list_first(&connection->fifo); 78 audio_data_link_t *data = audio_data_link_list_instance(l); 79 list_remove(&data->link); 80 audio_data_link_destroy(data); 81 } 76 audio_pipe_fini(&connection->fifo); 82 77 log_debug("DISCONNECTED: %s -> %s", 83 78 connection->source->name, connection->sink->name); … … 94 89 } 95 90 96 int connection_push_data(connection_t *connection, audio_data_t *adata)97 {98 assert(connection);99 assert(adata);100 audio_data_link_t *alink = audio_data_link_create(adata);101 if (!alink) {102 log_warning("Failed to buffer %zu bytes of data.", adata->size);103 return ENOMEM;104 }105 log_fatal("Pushed new data to connection fifo");106 list_append(&alink->link, &connection->fifo);107 return EOK;108 }109 110 111 91 /** 112 92 * @} -
uspace/srv/audio/hound/connection.h
rf1438e5 r50179b63 49 49 link_t sink_link; 50 50 link_t hound_link; 51 list_t fifo;51 audio_pipe_t fifo; 52 52 audio_sink_t *sink; 53 53 audio_source_t *source; … … 75 75 size_t size, pcm_format_t format); 76 76 77 int connection_push_data(connection_t *connection, audio_data_t *adata); 77 static inline int connection_push_data(connection_t *connection, 78 audio_data_t *adata) 79 { 80 assert(connection); 81 assert(adata); 82 return audio_pipe_push(&connection->fifo, adata); 83 } 78 84 79 85 static inline const char *connection_source_name(connection_t *connection)
Note:
See TracChangeset
for help on using the changeset viewer.