diff --git a/ges/ges-track-transition.c b/ges/ges-track-transition.c index 2696d688b7..8cd20bf550 100644 --- a/ges/ges-track-transition.c +++ b/ges/ges-track-transition.c @@ -198,11 +198,11 @@ link_element_to_mixer (GstElement * element, GstElement * mixer) static GObject * link_element_to_mixer_with_smpte (GstBin * bin, GstElement * element, - GstElement * mixer, GEnumValue * type) + GstElement * mixer, gint type) { GstElement *smptealpha = gst_element_factory_make ("smptealpha", NULL); g_object_set (G_OBJECT (smptealpha), - "type", (gint) type->value, "invert", (gboolean) TRUE, NULL); + "type", (gint) type, "invert", (gboolean) TRUE, NULL); gst_bin_add (bin, smptealpha); gst_element_link_many (element, smptealpha, mixer, NULL); @@ -426,7 +426,7 @@ ges_track_transition_init (GESTrackTransition * self) { self->vcontroller = NULL; self->vcontrol_source = NULL; - self->vtype = NULL; + self->vtype = 0; self->vstart_value = 0.0; self->vend_value = 0.0; @@ -441,7 +441,8 @@ GESTrackTransition * ges_track_transition_new (GEnumValue * type) { GESTrackTransition *ret = g_object_new (GES_TYPE_TRACK_TRANSITION, NULL); - ret->vtype = type; + if (type) + ret->vtype = type->value; return ret; } diff --git a/ges/ges-track-transition.h b/ges/ges-track-transition.h index a2e6e18c8d..9fc5eaee05 100644 --- a/ges/ges-track-transition.h +++ b/ges/ges-track-transition.h @@ -65,7 +65,7 @@ struct _GESTrackTransition /*< public >*/ /* given to to smpte alpha element */ - GEnumValue *vtype; + gint vtype; /*< private >*/ @@ -99,7 +99,7 @@ struct _GESTrackTransitionClass { GType ges_track_transition_get_type (void); -GESTrackTransition *ges_track_transition_new (GEnumValue * type); +GESTrackTransition *ges_track_transition_new (GEnumValue *type); G_END_DECLS diff --git a/tests/check/ges/transition.c b/tests/check/ges/transition.c index dc5ec43af2..3e144d5404 100644 --- a/tests/check/ges/transition.c +++ b/tests/check/ges/transition.c @@ -35,23 +35,23 @@ GST_START_TEST (test_transition_basic) ges_init (); track = ges_track_video_raw_new (); - fail_unless (track != NULL); + fail_unless (track != 0); tr1 = ges_timeline_transition_new (NULL); - fail_unless (tr1 != NULL); - fail_unless (tr1->vtype == NULL); + fail_unless (tr1 != 0); + fail_unless (tr1->vtype == 0); tr2 = ges_timeline_transition_new_for_nick ("bar-wipe-lr"); - fail_unless (tr2 != NULL); - fail_unless (tr2->vtype && tr2->vtype->value == 1); + fail_unless (tr2 != 0); + fail_unless (tr2->vtype->value == 1); /* Make sure track object is created and vtype is set */ trackobject = ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (tr2), track); - fail_unless (trackobject != NULL); - fail_unless (GES_TRACK_TRANSITION (trackobject)->vtype->value == 1); + fail_unless (trackobject != 0); + fail_unless (GES_TRACK_TRANSITION (trackobject)->vtype == 1); g_object_unref (trackobject); g_object_unref (track);