--- a/gst/fsrtpconference/fs-rtp-session.c +++ b/gst/fsrtpconference/fs-rtp-session.c @@ -268,7 +268,7 @@ static GType fs_rtp_session_get_stream_transmitter_type (FsSession *session, static void _substream_no_rtcp_timedout_cb (FsRtpSubStream *substream, FsRtpSession *session); static GstElement *_substream_get_codec_bin (FsRtpSubStream *substream, - FsRtpStream *stream, FsCodec *current_codec, FsCodec **new_codec, + FsRtpStream *stream, FsCodec **new_codec, guint current_builder_hash, guint *new_builder_hash, GError **error, FsRtpSession *session); @@ -3916,7 +3916,7 @@ fs_rtp_session_verify_send_codec_bin (FsRtpSession *self) static GstElement * _substream_get_codec_bin (FsRtpSubStream *substream, - FsRtpStream *stream, FsCodec *current_codec, FsCodec **new_codec, + FsRtpStream *stream, FsCodec **new_codec, guint current_builder_hash, guint *new_builder_hash, GError **error, FsRtpSession *session) { @@ -3940,12 +3940,6 @@ _substream_get_codec_bin (FsRtpSubStream *substream, current_builder_hash, new_builder_hash, error); g_free (name); - if (!codecbin) - { - fs_codec_destroy (*new_codec); - *new_codec = NULL; - } - out: fs_rtp_session_has_disposed_exit (session); diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c index c5c8183..fadafd9 100644 --- a/gst/fsrtpconference/fs-rtp-substream.c +++ b/gst/fsrtpconference/fs-rtp-substream.c @@ -394,9 +394,9 @@ fs_rtp_sub_stream_class_init (FsRtpSubStreamClass *klass) 0, NULL, NULL, - _fs_rtp_marshal_POINTER__POINTER_POINTER_POINTER_UINT_POINTER_POINTER, - G_TYPE_POINTER, 6, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, - G_TYPE_UINT, G_TYPE_POINTER, G_TYPE_POINTER); + _fs_rtp_marshal_POINTER__POINTER_POINTER_UINT_POINTER_POINTER, + G_TYPE_POINTER, 5, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_UINT, + G_TYPE_POINTER, G_TYPE_POINTER); /** @@ -925,12 +925,6 @@ fs_rtp_sub_stream_set_codecbin (FsRtpSubStream *substream, FS_RTP_SESSION_LOCK (substream->priv->session); substream->priv->codecbin = NULL; substream->priv->builder_hash = 0; - if (substream->codec) - { - fs_codec_destroy (substream->codec); - substream->codec = NULL; - } - FS_RTP_SESSION_UNLOCK (substream->priv->session); } @@ -989,7 +983,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; - substream->codec = codec; codec = NULL; if (substream->priv->stream && !substream->priv->output_ghostpad) @@ -1346,7 +1339,7 @@ _rtpbin_pad_blocked_callback (GstPad *pad, gboolean blocked, gpointer user_data) gst_pad_set_blocked_async (pad, FALSE, do_nothing_blocked_callback, NULL); g_signal_emit (substream, signals[GET_CODEC_BIN], 0, - substream->priv->stream, substream->codec, &codec, + substream->priv->stream, &codec, substream->priv->builder_hash, &new_builder_hash, &error, &codecbin); if (error) @@ -1359,6 +1352,10 @@ _rtpbin_pad_blocked_callback (GstPad *pad, gboolean blocked, gpointer user_data) GstCaps *caps; gchar *tmp; + if (substream->codec) + fs_codec_destroy (substream->codec); + substream->codec = codec; + caps = fs_codec_to_gst_caps (codec); tmp = gst_caps_to_string (caps); GST_DEBUG ("Setting caps %s on recv substream", tmp); @@ -1369,7 +1366,6 @@ _rtpbin_pad_blocked_callback (GstPad *pad, gboolean blocked, gpointer user_data) } FS_RTP_SESSION_UNLOCK (substream->priv->session); - if (codecbin) if (!fs_rtp_sub_stream_set_codecbin (substream, codec, codecbin, new_builder_hash, &error))