Commit a126d4a5 authored by Mohan R's avatar Mohan R

fixed segfault when autoaudiosink not available

parent 8d056b63
Pipeline #38598 canceled with stage
in 32 seconds
......@@ -254,6 +254,7 @@ static gboolean update_mmtime_timeout_cb(gpointer data)
SpiceGstaudioPrivate *p = gstaudio->priv;
GstQuery *q;
g_return_val_if_fail(p->playback.pipe != NULL, FALSE);
g_return_val_if_fail(!p->playback.fake, TRUE);
q = gst_query_new_latency();
......@@ -308,8 +309,11 @@ static void playback_start(SpicePlaybackChannel *channel, gint format, gint chan
p->playback.channels = channels;
cleanup:
if (error != NULL)
if (error != NULL) {
g_clear_pointer(&p->playback.pipe, gst_object_unref);
g_clear_pointer(&p->playback.src, gst_object_unref);
g_clear_pointer(&p->playback.sink, gst_object_unref);
}
g_clear_error(&error);
g_free(audio_caps);
g_free(pipeline);
......@@ -333,6 +337,7 @@ static void playback_data(SpicePlaybackChannel *channel,
GstBuffer *buf;
g_return_if_fail(p != NULL);
g_return_if_fail(p->playback.src != NULL);
audio = g_memdup(audio, size); /* TODO: try to avoid memory copy */
buf = gst_buffer_new_wrapped(audio, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment