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-18 09:24:09 +0200
commit9a6fa97569f636f4bb108ae1ad99c7e84d5de0df (patch)
tree847a90418bba7f5960b8c8b571f8bc3275daee1d
parent1263fce250e7ff24bd941dc8ef285314c2fdc9ed (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 1c59aa142..122adb1da 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
@@ -681,6 +702,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;