diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-07-28 12:16:12 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-07-28 14:16:35 +0300 |
commit | 4e2eb93f043e72cbdbfae67689fd9af84fcdfde4 (patch) | |
tree | cb3047f506bcad7e607ce4fd1ab52d9ef6f55302 | |
parent | 5e5a14028a8605f957b5acf2c2170850d02a7b51 (diff) |
capsfilter: When switching caps change modes, forget all previous caps
-rw-r--r-- | plugins/elements/gstcapsfilter.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index 0035c4737..f86f72911 100644 --- a/plugins/elements/gstcapsfilter.c +++ b/plugins/elements/gstcapsfilter.c @@ -213,9 +213,21 @@ gst_capsfilter_set_property (GObject * object, guint prop_id, gst_base_transform_reconfigure_sink (GST_BASE_TRANSFORM (object)); break; } - case PROP_CAPS_CHANGE_MODE: + case PROP_CAPS_CHANGE_MODE:{ + GstCapsFilterCapsChangeMode old_change_mode; + + GST_OBJECT_LOCK (capsfilter); + old_change_mode = capsfilter->caps_change_mode; capsfilter->caps_change_mode = g_value_get_enum (value); + + if (capsfilter->caps_change_mode != old_change_mode) { + g_list_free_full (capsfilter->previous_caps, + (GDestroyNotify) gst_caps_unref); + capsfilter->previous_caps = NULL; + } + GST_OBJECT_UNLOCK (capsfilter); break; + } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; |