From 1d0ce27005abf0944ec9ff48515b378c726003a6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 14 Apr 2020 15:42:25 +0200 Subject: [PATCH] stream: remove useless size on input streams Setting the size on input stream buffers based on the elapsed ticks does not give a meaningfull value for the queue size so just leave it to the user to set the size field. --- src/pipewire/stream.c | 9 ++------- src/pipewire/stream.h | 9 +++------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index de1e28eb4..b39cd84c1 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -717,12 +717,9 @@ static int impl_node_process_input(void *object) struct pw_stream *stream = &impl->this; struct spa_io_buffers *io = impl->io; struct buffer *b; - uint64_t size; - size = impl->time.ticks - impl->dequeued.incount; - - pw_log_trace(NAME" %p: process in status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64" size:%"PRIi64, - stream, io->status, io->buffer_id, impl->time.ticks, impl->time.delay, size); + pw_log_trace(NAME" %p: process in status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64, + stream, io->status, io->buffer_id, impl->time.ticks, impl->time.delay); if (io->status != SPA_STATUS_HAVE_DATA) goto done; @@ -730,8 +727,6 @@ static int impl_node_process_input(void *object) if ((b = get_buffer(stream, io->buffer_id)) == NULL) goto done; - b->this.size = size; - /* push new buffer */ if (push_queue(impl, &impl->dequeued, b) == 0) call_process(impl); diff --git a/src/pipewire/stream.h b/src/pipewire/stream.h index a6bcb9b9f..5b2ba03d3 100644 --- a/src/pipewire/stream.h +++ b/src/pipewire/stream.h @@ -154,7 +154,7 @@ struct pw_stream; /** \enum pw_stream_state The state of a stream \memberof pw_stream */ enum pw_stream_state { - PW_STREAM_STATE_ERROR = -1, /**< the strean is in error */ + PW_STREAM_STATE_ERROR = -1, /**< the stream is in error */ PW_STREAM_STATE_UNCONNECTED = 0, /**< unconnected */ PW_STREAM_STATE_CONNECTING = 1, /**< connection is in progress */ PW_STREAM_STATE_PAUSED = 2, /**< paused */ @@ -164,11 +164,8 @@ enum pw_stream_state { struct pw_buffer { struct spa_buffer *buffer; /**< the spa buffer */ void *user_data; /**< user data attached to the buffer */ - uint64_t size; /**< For input streams, this field is set by pw_stream - * with the duration of the buffer in ticks. - * For output streams, this field is set by the user. - * This field is added for all queued buffers and - * returned in the time info. */ + uint64_t size; /**< This field is set by the user and the sum of + * all queued buffer is returned in the time info */ }; struct pw_stream_control {