mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-27 07:00:12 -05:00
pinossrc: don't send empty buffers
This commit is contained in:
parent
4149e34e67
commit
bc73610dd0
1 changed files with 7 additions and 5 deletions
|
|
@ -351,7 +351,7 @@ on_new_buffer (GObject *gobject,
|
||||||
GstPinosSrc *pinossrc = user_data;
|
GstPinosSrc *pinossrc = user_data;
|
||||||
PinosBuffer *pbuf;
|
PinosBuffer *pbuf;
|
||||||
PinosBufferIter it;
|
PinosBufferIter it;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf = NULL;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
GST_LOG_OBJECT (pinossrc, "got new buffer");
|
GST_LOG_OBJECT (pinossrc, "got new buffer");
|
||||||
|
|
@ -360,8 +360,6 @@ on_new_buffer (GObject *gobject,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = gst_buffer_new ();
|
|
||||||
|
|
||||||
pinos_buffer_iter_init (&it, pbuf);
|
pinos_buffer_iter_init (&it, pbuf);
|
||||||
while (pinos_buffer_iter_next (&it)) {
|
while (pinos_buffer_iter_next (&it)) {
|
||||||
switch (pinos_buffer_iter_get_type (&it)) {
|
switch (pinos_buffer_iter_get_type (&it)) {
|
||||||
|
|
@ -372,6 +370,9 @@ on_new_buffer (GObject *gobject,
|
||||||
if (!pinos_buffer_iter_parse_header (&it, &hdr))
|
if (!pinos_buffer_iter_parse_header (&it, &hdr))
|
||||||
goto parse_failed;
|
goto parse_failed;
|
||||||
|
|
||||||
|
if (buf == NULL)
|
||||||
|
buf = gst_buffer_new ();
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (hdr.pts)) {
|
if (GST_CLOCK_TIME_IS_VALID (hdr.pts)) {
|
||||||
if (hdr.pts > GST_ELEMENT_CAST (pinossrc)->base_time)
|
if (hdr.pts > GST_ELEMENT_CAST (pinossrc)->base_time)
|
||||||
GST_BUFFER_PTS (buf) = hdr.pts - GST_ELEMENT_CAST (pinossrc)->base_time;
|
GST_BUFFER_PTS (buf) = hdr.pts - GST_ELEMENT_CAST (pinossrc)->base_time;
|
||||||
|
|
@ -395,6 +396,9 @@ on_new_buffer (GObject *gobject,
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
goto no_fds;
|
goto no_fds;
|
||||||
|
|
||||||
|
if (buf == NULL)
|
||||||
|
buf = gst_buffer_new ();
|
||||||
|
|
||||||
fdmem = gst_fd_allocator_alloc (pinossrc->fd_allocator, fd,
|
fdmem = gst_fd_allocator_alloc (pinossrc->fd_allocator, fd,
|
||||||
data.p.offset + data.p.size, GST_FD_MEMORY_FLAG_NONE);
|
data.p.offset + data.p.size, GST_FD_MEMORY_FLAG_NONE);
|
||||||
gst_memory_resize (fdmem, data.p.offset, data.p.size);
|
gst_memory_resize (fdmem, data.p.offset, data.p.size);
|
||||||
|
|
@ -631,8 +635,6 @@ gst_pinos_src_negotiate (GstBaseSrc * basesrc)
|
||||||
|
|
||||||
g_bytes_unref (possible);
|
g_bytes_unref (possible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* now fixate */
|
/* now fixate */
|
||||||
GST_DEBUG_OBJECT (basesrc, "server fixated caps: %" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (basesrc, "server fixated caps: %" GST_PTR_FORMAT, caps);
|
||||||
if (gst_caps_is_any (caps)) {
|
if (gst_caps_is_any (caps)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue