ges: Handle supported formats in TimelineStandardTransition
authorThibault Saunier <thibault.saunier@collabora.com>
Thu, 1 Dec 2011 03:33:38 +0000 (00:33 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Wed, 11 Jan 2012 14:56:15 +0000 (11:56 -0300)
ges/ges-timeline-standard-transition.c

index 713b82a08ae1ab4fa43256f4300e8395ee17a7f8..b2e2b71504f921a56485bc6215641c42fb445789 100644 (file)
@@ -192,16 +192,21 @@ ges_tl_transition_create_track_object (GESTimelineObject * obj,
   GESTimelineStandardTransition *transition =
       (GESTimelineStandardTransition *) obj;
   GESTrackObject *res;
+  GESTrackType supportedformats;
 
   GST_DEBUG ("Creating a GESTrackTransition");
 
-  if (track->type == GES_TRACK_TYPE_VIDEO) {
+  supportedformats = ges_timeline_object_get_supported_formats (obj);
+  if (track->type == GES_TRACK_TYPE_VIDEO &&
+      (supportedformats == GES_TRACK_TYPE_UNKNOWN ||
+          supportedformats & GES_TRACK_TYPE_VIDEO)) {
     res = GES_TRACK_OBJECT (ges_track_video_transition_new ());
     ges_track_video_transition_set_transition_type ((GESTrackVideoTransition *)
         res, transition->vtype);
-  }
 
-  else if (track->type == GES_TRACK_TYPE_AUDIO) {
+  } else if (track->type == GES_TRACK_TYPE_AUDIO &&
+      (supportedformats == GES_TRACK_TYPE_UNKNOWN ||
+          supportedformats & GES_TRACK_TYPE_AUDIO)) {
     res = GES_TRACK_OBJECT (ges_track_audio_transition_new ());
   }