mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
stream: remove QUEUED buffer flag
The flag was used to see if a buffer was in a queue or not but that doesn't really matter much and with the DEQUEUED flag we can only move buffers from dequeued to queued.
This commit is contained in:
parent
220bdf8a00
commit
b6ce585da6
1 changed files with 3 additions and 8 deletions
|
|
@ -39,9 +39,8 @@ struct buffer {
|
||||||
struct pw_buffer this;
|
struct pw_buffer this;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
#define BUFFER_FLAG_MAPPED (1 << 0)
|
#define BUFFER_FLAG_MAPPED (1 << 0)
|
||||||
#define BUFFER_FLAG_QUEUED (1 << 1)
|
#define BUFFER_FLAG_DEQUEUED (1 << 1)
|
||||||
#define BUFFER_FLAG_DEQUEUED (1 << 2)
|
#define BUFFER_FLAG_ADDED (1 << 2)
|
||||||
#define BUFFER_FLAG_ADDED (1 << 3)
|
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
struct spa_meta_busy *busy;
|
struct spa_meta_busy *busy;
|
||||||
};
|
};
|
||||||
|
|
@ -358,11 +357,9 @@ static inline int queue_push(struct stream *stream, struct queue *queue, struct
|
||||||
{
|
{
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
|
|
||||||
if (SPA_FLAG_IS_SET(buffer->flags, BUFFER_FLAG_QUEUED) ||
|
if (buffer->id >= stream->n_buffers)
|
||||||
buffer->id >= stream->n_buffers)
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
SPA_FLAG_SET(buffer->flags, BUFFER_FLAG_QUEUED);
|
|
||||||
queue->incount += buffer->this.size;
|
queue->incount += buffer->this.size;
|
||||||
|
|
||||||
spa_ringbuffer_get_write_index(&queue->ring, &index);
|
spa_ringbuffer_get_write_index(&queue->ring, &index);
|
||||||
|
|
@ -393,7 +390,6 @@ static inline struct buffer *queue_pop(struct stream *stream, struct queue *queu
|
||||||
|
|
||||||
buffer = &stream->buffers[id];
|
buffer = &stream->buffers[id];
|
||||||
queue->outcount += buffer->this.size;
|
queue->outcount += buffer->this.size;
|
||||||
SPA_FLAG_CLEAR(buffer->flags, BUFFER_FLAG_QUEUED);
|
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
@ -2563,7 +2559,6 @@ static inline int queue_push_front(struct stream *stream, struct queue *queue, s
|
||||||
index -= 1;
|
index -= 1;
|
||||||
queue->ids[index & MASK_BUFFERS] = buffer->id;
|
queue->ids[index & MASK_BUFFERS] = buffer->id;
|
||||||
queue->outcount -= buffer->this.size;
|
queue->outcount -= buffer->this.size;
|
||||||
SPA_FLAG_SET(buffer->flags, BUFFER_FLAG_QUEUED);
|
|
||||||
spa_ringbuffer_read_update(&queue->ring, index);
|
spa_ringbuffer_read_update(&queue->ring, index);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue