mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
stream: only call process when we have a dequeued buffer
This commit is contained in:
parent
2bb2e50eef
commit
bfefd76055
2 changed files with 4 additions and 7 deletions
|
|
@ -46,7 +46,6 @@
|
||||||
|
|
||||||
#define MAX_SAMPLES 8192
|
#define MAX_SAMPLES 8192
|
||||||
#define MAX_BUFFERS 64
|
#define MAX_BUFFERS 64
|
||||||
#define MIN_QUEUED 1
|
|
||||||
|
|
||||||
#define MASK_BUFFERS (MAX_BUFFERS-1)
|
#define MASK_BUFFERS (MAX_BUFFERS-1)
|
||||||
#define MAX_PORTS 1024
|
#define MAX_PORTS 1024
|
||||||
|
|
@ -280,7 +279,7 @@ static inline struct buffer *pop_queue(struct port *port, struct queue *queue)
|
||||||
uint32_t index, id;
|
uint32_t index, id;
|
||||||
struct buffer *buffer;
|
struct buffer *buffer;
|
||||||
|
|
||||||
if ((avail = spa_ringbuffer_get_read_index(&queue->ring, &index)) < MIN_QUEUED) {
|
if ((avail = spa_ringbuffer_get_read_index(&queue->ring, &index)) < 1) {
|
||||||
errno = EPIPE;
|
errno = EPIPE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@
|
||||||
#define NAME "stream"
|
#define NAME "stream"
|
||||||
|
|
||||||
#define MAX_BUFFERS 64
|
#define MAX_BUFFERS 64
|
||||||
#define MIN_QUEUED 1
|
|
||||||
|
|
||||||
#define MASK_BUFFERS (MAX_BUFFERS-1)
|
#define MASK_BUFFERS (MAX_BUFFERS-1)
|
||||||
#define MAX_PORTS 1
|
#define MAX_PORTS 1
|
||||||
|
|
@ -248,7 +247,7 @@ static inline struct buffer *pop_queue(struct stream *stream, struct queue *queu
|
||||||
uint32_t index, id;
|
uint32_t index, id;
|
||||||
struct buffer *buffer;
|
struct buffer *buffer;
|
||||||
|
|
||||||
if ((avail = spa_ringbuffer_get_read_index(&queue->ring, &index)) < MIN_QUEUED) {
|
if ((avail = spa_ringbuffer_get_read_index(&queue->ring, &index)) < 1) {
|
||||||
errno = EPIPE;
|
errno = EPIPE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -761,8 +760,7 @@ static int impl_node_process_output(void *object)
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
pw_log_trace(NAME" %p: process out status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64, stream,
|
pw_log_trace(NAME" %p: process out status:%d id:%d", stream, io->status, io->buffer_id);
|
||||||
io->status, io->buffer_id, impl->time.ticks, impl->time.delay);
|
|
||||||
|
|
||||||
if ((res = io->status) != SPA_STATUS_HAVE_DATA) {
|
if ((res = io->status) != SPA_STATUS_HAVE_DATA) {
|
||||||
/* recycle old buffer */
|
/* recycle old buffer */
|
||||||
|
|
@ -790,7 +788,7 @@ again:
|
||||||
|
|
||||||
if (!impl->draining &&
|
if (!impl->draining &&
|
||||||
!SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER) &&
|
!SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER) &&
|
||||||
spa_ringbuffer_get_read_index(&impl->queued.ring, &index) < MIN_QUEUED) {
|
spa_ringbuffer_get_read_index(&impl->dequeued.ring, &index) > 0) {
|
||||||
call_process(impl);
|
call_process(impl);
|
||||||
if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0 &&
|
if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0 &&
|
||||||
io->status == SPA_STATUS_NEED_DATA)
|
io->status == SPA_STATUS_NEED_DATA)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue