From 8132aecf99071faab59739ebabd7bcd41a2ab581 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 27 Nov 2009 11:14:58 -0600 Subject: [PATCH 09/24] fix to avoid parsing caps on every frame --- gst/stride/gststridetransform.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gst/stride/gststridetransform.c b/gst/stride/gststridetransform.c index 03deeb1..143a9f7 100644 --- a/gst/stride/gststridetransform.c +++ b/gst/stride/gststridetransform.c @@ -197,11 +197,15 @@ gst_stride_transform_transform_size (GstBaseTransform *base, if (self->cached_caps[idx] != othercaps) { - if (!gst_stride_transform_get_unit_size (base, othercaps, - &(self->cached_size[idx]))) - { + guint sz; + if (!gst_stride_transform_get_unit_size (base, othercaps, &sz)) { return FALSE; } + if (self->cached_caps[idx]) { + gst_caps_unref (self->cached_caps[idx]); + } + self->cached_size[idx] = sz; + self->cached_caps[idx] = gst_caps_ref (othercaps); } *othersize = self->cached_size[idx]; -- 1.7.1