mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
module-rtp: set the EMPTY flag on empty buffers
And make sure other flags are reset.
This commit is contained in:
parent
70aaec0ac4
commit
47ee9ef10a
3 changed files with 9 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ static void rtp_audio_process_playback(void *data)
|
|||
struct pw_buffer *buf;
|
||||
struct spa_data *d;
|
||||
uint32_t wanted, timestamp, target_buffer, stride, maxsize;
|
||||
int32_t avail;
|
||||
int32_t avail, flags = 0;
|
||||
|
||||
if ((buf = pw_stream_dequeue_buffer(impl->stream)) == NULL) {
|
||||
pw_log_info("Out of stream buffers: %m");
|
||||
|
|
@ -35,6 +35,8 @@ static void rtp_audio_process_playback(void *data)
|
|||
if (avail < (int32_t)wanted) {
|
||||
enum spa_log_level level;
|
||||
memset(d[0].data, 0, wanted * stride);
|
||||
flags |= SPA_CHUNK_FLAG_EMPTY;
|
||||
|
||||
if (impl->have_sync) {
|
||||
impl->have_sync = false;
|
||||
level = SPA_LOG_LEVEL_INFO;
|
||||
|
|
@ -95,9 +97,10 @@ static void rtp_audio_process_playback(void *data)
|
|||
timestamp += wanted;
|
||||
spa_ringbuffer_read_update(&impl->ring, timestamp);
|
||||
}
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->size = wanted * stride;
|
||||
d[0].chunk->stride = stride;
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->flags = flags;
|
||||
buf->size = wanted;
|
||||
|
||||
pw_stream_queue_buffer(impl->stream, buf);
|
||||
|
|
|
|||
|
|
@ -83,9 +83,10 @@ complete:
|
|||
pw_log_warn("overflow buffer %u %u", b.state.offset, maxsize);
|
||||
b.state.offset = 0;
|
||||
}
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->size = b.state.offset;
|
||||
d[0].chunk->stride = 1;
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->flags = 0;
|
||||
done:
|
||||
pw_stream_queue_buffer(impl->stream, buf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,10 @@ static void rtp_opus_process_playback(void *data)
|
|||
timestamp += wanted;
|
||||
spa_ringbuffer_read_update(&impl->ring, timestamp);
|
||||
}
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->size = wanted * stride;
|
||||
d[0].chunk->stride = stride;
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->flags = 0;
|
||||
buf->size = wanted;
|
||||
|
||||
pw_stream_queue_buffer(impl->stream, buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue