summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-03-29 14:44:50 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-03-29 16:29:46 -0400
commit54e28e95bed4f04bc95dae509c3724399c79fa29 (patch)
treed0a663625edd4160df74ccf2a2c0d224f9712176
parent7124e5242b56b9c3ad275a512ae962cc682e3067 (diff)
downloadfarstream-0.1.tar.gz
rtpsubstream: Don't free codec after setting it inside substreamfarstream-0.1
Bug discovered by Havard Graff
-rw-r--r--gst/fsrtpconference/fs-rtp-substream.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c
index 13c2c549..92d1dba3 100644
--- a/gst/fsrtpconference/fs-rtp-substream.c
+++ b/gst/fsrtpconference/fs-rtp-substream.c
@@ -897,7 +897,6 @@ fs_rtp_sub_stream_get_property (GObject *object,
static gboolean
fs_rtp_sub_stream_set_codecbin (FsRtpSubStream *substream,
- FsCodec *codec,
GstElement *codecbin,
guint builder_hash,
GError **error)
@@ -917,7 +916,6 @@ fs_rtp_sub_stream_set_codecbin (FsRtpSubStream *substream,
" and payload type %d to the state NULL", substream->ssrc,
substream->pt);
gst_object_unref (codecbin);
- fs_codec_destroy (codec);
return FALSE;
}
@@ -934,7 +932,6 @@ fs_rtp_sub_stream_set_codecbin (FsRtpSubStream *substream,
if (!gst_bin_add (GST_BIN (substream->priv->conference), codecbin))
{
gst_object_unref (codecbin);
- fs_codec_destroy (codec);
g_set_error (error, FS_ERROR, FS_ERROR_CONSTRUCTION,
"Could not add the codec bin to the conference");
return FALSE;
@@ -985,7 +982,6 @@ fs_rtp_sub_stream_set_codecbin (FsRtpSubStream *substream,
FS_RTP_SESSION_LOCK (substream->priv->session);
substream->priv->codecbin = codecbin;
substream->priv->builder_hash = builder_hash;
- codec = NULL;
if (substream->priv->stream && !substream->priv->output_ghostpad)
{
@@ -1007,8 +1003,6 @@ fs_rtp_sub_stream_set_codecbin (FsRtpSubStream *substream,
gst_element_set_state (codecbin, GST_STATE_NULL);
gst_bin_remove (GST_BIN (substream->priv->conference), codecbin);
- fs_codec_destroy (codec);
-
return ret;
}
@@ -1367,11 +1361,15 @@ _rtpbin_pad_blocked_callback (GstPad *pad, gboolean blocked, gpointer user_data)
fs_rtp_sub_stream_add_probe_locked (substream);
}
+ else if (codec)
+ {
+ fs_codec_destroy (codec);
+ }
FS_RTP_SESSION_UNLOCK (substream->priv->session);
if (codecbin)
- if (!fs_rtp_sub_stream_set_codecbin (substream, codec, codecbin,
- new_builder_hash, &error))
+ if (!fs_rtp_sub_stream_set_codecbin (substream, codecbin, new_builder_hash,
+ &error))
goto error;
out: