diff options
author | Dave Robillard <dave@drobilla.net> | 2009-07-03 20:01:30 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-07-03 20:01:30 -0400 |
commit | caba48f261421d397900471b19350da2e5a4a4e5 (patch) | |
tree | ace87e1bd5c819454aefaa722203c30ed83f4ec1 /gst/frei0r/gstfrei0rmixer.c | |
parent | 699e4f4d044d8111053b631baba4b324a60b1274 (diff) | |
parent | 6a763f6a471e9fbbd86358b0175498a6af78666e (diff) | |
download | gst-plugins-bad-caba48f261421d397900471b19350da2e5a4a4e5.tar.gz gst-plugins-bad-caba48f261421d397900471b19350da2e5a4a4e5.tar.bz2 gst-plugins-bad-caba48f261421d397900471b19350da2e5a4a4e5.zip |
Merge branch 'master' of git://anongit.freedesktop.org/gstreamer/gst-plugins-bad into fdo
Diffstat (limited to 'gst/frei0r/gstfrei0rmixer.c')
-rw-r--r-- | gst/frei0r/gstfrei0rmixer.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/gst/frei0r/gstfrei0rmixer.c b/gst/frei0r/gstfrei0rmixer.c index 745c330e..8f3ee4ba 100644 --- a/gst/frei0r/gstfrei0rmixer.c +++ b/gst/frei0r/gstfrei0rmixer.c @@ -45,8 +45,16 @@ gst_frei0r_mixer_reset (GstFrei0rMixer * self) self->f0r_instance = NULL; } + if (self->property_cache) + gst_frei0r_property_cache_free (klass->properties, self->property_cache, + klass->n_properties); + self->property_cache = NULL; + gst_caps_replace (&self->caps, NULL); gst_event_replace (&self->newseg_event, NULL); + + self->fmt = GST_VIDEO_FORMAT_UNKNOWN; + self->width = self->height = 0; } static void @@ -195,7 +203,6 @@ static gboolean gst_frei0r_mixer_set_caps (GstPad * pad, GstCaps * caps) { GstFrei0rMixer *self = GST_FREI0R_MIXER (gst_pad_get_parent (pad)); - GstFrei0rMixerClass *klass = GST_FREI0R_MIXER_GET_CLASS (self); gboolean ret = TRUE; gst_caps_replace (&self->caps, caps); @@ -215,16 +222,6 @@ gst_frei0r_mixer_set_caps (GstPad * pad, GstCaps * caps) ret = FALSE; goto out; } - - if (self->f0r_instance) { - klass->ftable->destruct (self->f0r_instance); - self->f0r_instance = NULL; - } - - self->f0r_instance = - gst_frei0r_instance_construct (klass->ftable, klass->properties, - klass->n_properties, self->property_cache, self->width, self->height); - } out: @@ -543,9 +540,17 @@ gst_frei0r_mixer_collected (GstCollectPads * pads, GstFrei0rMixer * self) GstFrei0rMixerClass *klass = GST_FREI0R_MIXER_GET_CLASS (self); gdouble time; - if (G_UNLIKELY (!self->f0r_instance)) + if (G_UNLIKELY (self->width <= 0 || self->height <= 0)) return GST_FLOW_NOT_NEGOTIATED; + if (G_UNLIKELY (!self->f0r_instance)) { + self->f0r_instance = + gst_frei0r_instance_construct (klass->ftable, klass->properties, + klass->n_properties, self->property_cache, self->width, self->height); + if (G_UNLIKELY (!self->f0r_instance)) + return GST_FLOW_ERROR; + } + if (self->newseg_event) { gst_pad_push_event (self->src, self->newseg_event); self->newseg_event = NULL; |