summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Greenwood <tcdgreenwood@hotmail.com>2013-04-10 20:45:37 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-04-15 10:00:05 +0200
commit789ddf42a90b2185bc0cc6cf5e0f1319ce72d296 (patch)
tree398c20c7d34b04b7e66906d20a736e386dda9718
parent0b83d13231ed25d624d75a2f4df6d43f0f64de7c (diff)
rtpbasedepayload: Ignore caps events if the caps did not change
https://bugzilla.gnome.org/show_bug.cgi?id=697672
-rw-r--r--gst-libs/gst/rtp/gstrtpbasedepayload.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gst-libs/gst/rtp/gstrtpbasedepayload.c b/gst-libs/gst/rtp/gstrtpbasedepayload.c
index 78691843a..33a0f30cc 100644
--- a/gst-libs/gst/rtp/gstrtpbasedepayload.c
+++ b/gst-libs/gst/rtp/gstrtpbasedepayload.c
@@ -48,6 +48,8 @@ struct _GstRTPBaseDepayloadPrivate
guint32 next_seqnum;
gboolean negotiated;
+
+ GstCaps *last_caps;
};
/* Filter signals and args */
@@ -188,7 +190,17 @@ gst_rtp_base_depayload_setcaps (GstRTPBaseDepayload * filter, GstCaps * caps)
bclass = GST_RTP_BASE_DEPAYLOAD_GET_CLASS (filter);
- GST_DEBUG_OBJECT (filter, "Set caps");
+ GST_DEBUG_OBJECT (filter, "Set caps %" GST_PTR_FORMAT, caps);
+
+ if (priv->last_caps) {
+ if (gst_caps_is_equal (priv->last_caps, caps)) {
+ res = TRUE;
+ goto caps_not_changed;
+ } else {
+ gst_caps_unref (priv->last_caps);
+ priv->last_caps = NULL;
+ }
+ }
caps_struct = gst_caps_get_structure (caps, 0);
@@ -232,7 +244,16 @@ gst_rtp_base_depayload_setcaps (GstRTPBaseDepayload * filter, GstCaps * caps)
priv->negotiated = res;
+ if (priv->negotiated)
+ priv->last_caps = gst_caps_ref (caps);
+
return res;
+
+caps_not_changed:
+ {
+ GST_DEBUG_OBJECT (filter, "Caps did not change");
+ return res;
+ }
}
static GstFlowReturn
@@ -677,6 +698,7 @@ gst_rtp_base_depayload_change_state (GstElement * element,
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ gst_caps_replace (&priv->last_caps, NULL);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
break;