Changeset feeac0d in mainline for uspace/srv/audio/hound/hound_ctx.c
- Timestamp:
- 2013-09-10T16:32:35Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4982d87
- Parents:
- e8d6ce2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/hound_ctx.c
re8d6ce2 rfeeac0d 176 176 177 177 /** 178 * List instance helper.179 * @param l link180 * @return pointer to a hound context structure, NULL on failure.181 */182 static inline hound_ctx_stream_t *hound_ctx_stream_from_link(link_t *l)183 {184 return l ? list_get_instance(l, hound_ctx_stream_t, link) : NULL;185 }186 187 /**188 178 * New stream append helper. 189 179 * @param ctx hound context. … … 417 407 pcm_format_silence(buffer, size, &source->format); 418 408 fibril_mutex_lock(&ctx->guard); 419 list_foreach(ctx->streams, it) { 420 hound_ctx_stream_t *stream = hound_ctx_stream_from_link(it); 409 list_foreach(ctx->streams, link, hound_ctx_stream_t, stream) { 421 410 ssize_t copied = hound_ctx_stream_add_self( 422 411 stream, buffer, size, &source->format); … … 426 415 log_verbose("CTX: %p. Pushing audio to %u connections", ctx, 427 416 list_count(&source->connections)); 428 list_foreach(source->connections, it) { 429 connection_t *conn = connection_from_source_list(it); 417 list_foreach(source->connections, source_link, connection_t, conn) { 430 418 connection_push_data(conn, adata); 431 419 } … … 444 432 /* count available data */ 445 433 size_t available_frames = -1; /* this is ugly.... */ 446 list_foreach(sink->connections, it) { 447 connection_t *conn = connection_from_source_list(it); 434 list_foreach(sink->connections, source_link, connection_t, conn) { 448 435 available_frames = min(available_frames, 449 436 audio_pipe_frames(&conn->fifo)); … … 466 453 /* mix data */ 467 454 pcm_format_silence(buffer, bsize, &sink->format); 468 list_foreach(sink->connections, it) { 469 connection_t *conn = connection_from_source_list(it); 455 list_foreach(sink->connections, source_link, connection_t, conn) { 470 456 /* This should not trigger data update on the source */ 471 457 const size_t copied = connection_add_source_data( … … 476 462 } 477 463 /* push to all streams */ 478 list_foreach(ctx->streams, it) { 479 hound_ctx_stream_t *stream = hound_ctx_stream_from_link(it); 464 list_foreach(ctx->streams, link, hound_ctx_stream_t, stream) { 480 465 const int ret = stream_push_data(stream, adata); 481 466 if (ret != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.