mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
small cleanups and some leak fixing
This commit is contained in:
parent
c47fcd8105
commit
ec5b9b26df
2 changed files with 14 additions and 2 deletions
|
|
@ -238,9 +238,9 @@ pinos_stream_finalize (GObject * object)
|
||||||
g_clear_object (&priv->context);
|
g_clear_object (&priv->context);
|
||||||
g_free (priv->name);
|
g_free (priv->name);
|
||||||
|
|
||||||
|
g_free (priv->buffer.data);
|
||||||
if (priv->buffer.message)
|
if (priv->buffer.message)
|
||||||
g_object_unref (priv->buffer.message);
|
g_object_unref (priv->buffer.message);
|
||||||
g_free (priv->buffer.data);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (pinos_stream_parent_class)->finalize (object);
|
G_OBJECT_CLASS (pinos_stream_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
@ -1098,6 +1098,7 @@ pinos_stream_capture_buffer (PinosStream *stream,
|
||||||
|
|
||||||
priv = stream->priv;
|
priv = stream->priv;
|
||||||
g_return_val_if_fail (priv->state == PINOS_STREAM_STATE_STREAMING, FALSE);
|
g_return_val_if_fail (priv->state == PINOS_STREAM_STATE_STREAMING, FALSE);
|
||||||
|
g_return_val_if_fail (is_valid_buffer (&priv->buffer), FALSE);
|
||||||
|
|
||||||
memcpy (buffer, &priv->buffer, sizeof (PinosStackBuffer));
|
memcpy (buffer, &priv->buffer, sizeof (PinosStackBuffer));
|
||||||
|
|
||||||
|
|
@ -1105,6 +1106,7 @@ pinos_stream_capture_buffer (PinosStream *stream,
|
||||||
priv->buffer.allocated_size = 0;
|
priv->buffer.allocated_size = 0;
|
||||||
priv->buffer.size = 0;
|
priv->buffer.size = 0;
|
||||||
priv->buffer.message = NULL;
|
priv->buffer.message = NULL;
|
||||||
|
priv->buffer.magic = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
@ -1115,7 +1117,8 @@ pinos_stream_capture_buffer (PinosStream *stream,
|
||||||
* @buffer: a #PinosBuffer
|
* @buffer: a #PinosBuffer
|
||||||
*
|
*
|
||||||
* Release @buffer back to @stream. This function should be called whenever the
|
* Release @buffer back to @stream. This function should be called whenever the
|
||||||
* buffer is processed.
|
* buffer is processed. @buffer should not be used anymore after calling this
|
||||||
|
* function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pinos_stream_release_buffer (PinosStream *stream,
|
pinos_stream_release_buffer (PinosStream *stream,
|
||||||
|
|
@ -1139,6 +1142,8 @@ pinos_stream_release_buffer (PinosStream *stream,
|
||||||
|
|
||||||
if (sb->message)
|
if (sb->message)
|
||||||
g_object_unref (sb->message);
|
g_object_unref (sb->message);
|
||||||
|
|
||||||
|
sb->magic = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -558,6 +558,13 @@ gst_pinos_src_start (GstBaseSrc * basesrc)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_pinos_src_stop (GstBaseSrc * basesrc)
|
gst_pinos_src_stop (GstBaseSrc * basesrc)
|
||||||
{
|
{
|
||||||
|
GstPinosSrc *pinossrc;
|
||||||
|
|
||||||
|
pinossrc = GST_PINOS_SRC (basesrc);
|
||||||
|
if (pinossrc->current)
|
||||||
|
gst_buffer_unref (pinossrc->current);
|
||||||
|
pinossrc->current = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue