Changes in uspace/srv/audio/hound/hound_ctx.c [feeac0d:e5bc912] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/hound_ctx.c
rfeeac0d re5bc912 176 176 177 177 /** 178 * List instance helper. 179 * @param l link 180 * @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 /** 178 188 * New stream append helper. 179 189 * @param ctx hound context. … … 407 417 pcm_format_silence(buffer, size, &source->format); 408 418 fibril_mutex_lock(&ctx->guard); 409 list_foreach(ctx->streams, link, hound_ctx_stream_t, stream) { 419 list_foreach(ctx->streams, it) { 420 hound_ctx_stream_t *stream = hound_ctx_stream_from_link(it); 410 421 ssize_t copied = hound_ctx_stream_add_self( 411 422 stream, buffer, size, &source->format); … … 415 426 log_verbose("CTX: %p. Pushing audio to %u connections", ctx, 416 427 list_count(&source->connections)); 417 list_foreach(source->connections, source_link, connection_t, conn) { 428 list_foreach(source->connections, it) { 429 connection_t *conn = connection_from_source_list(it); 418 430 connection_push_data(conn, adata); 419 431 } … … 432 444 /* count available data */ 433 445 size_t available_frames = -1; /* this is ugly.... */ 434 list_foreach(sink->connections, source_link, connection_t, conn) { 446 list_foreach(sink->connections, it) { 447 connection_t *conn = connection_from_source_list(it); 435 448 available_frames = min(available_frames, 436 449 audio_pipe_frames(&conn->fifo)); … … 453 466 /* mix data */ 454 467 pcm_format_silence(buffer, bsize, &sink->format); 455 list_foreach(sink->connections, source_link, connection_t, conn) { 468 list_foreach(sink->connections, it) { 469 connection_t *conn = connection_from_source_list(it); 456 470 /* This should not trigger data update on the source */ 457 471 const size_t copied = connection_add_source_data( … … 462 476 } 463 477 /* push to all streams */ 464 list_foreach(ctx->streams, link, hound_ctx_stream_t, stream) { 478 list_foreach(ctx->streams, it) { 479 hound_ctx_stream_t *stream = hound_ctx_stream_from_link(it); 465 480 const int ret = stream_push_data(stream, adata); 466 481 if (ret != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.