diff --git a/ChangeLog b/ChangeLog index 2110bd0fcc..0d5f10f4a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-04 Sebastian Dröge + + * gst/videoscale/gstvideoscale.c: (gst_video_scale_transform_caps): + Transform a given PAR to a range on the struct with the generic + height/width instead of the struct with the possibly restricted + height/width. + 2008-06-04 Sebastian Dröge * gst/videoscale/gstvideoscale.c: (gst_video_scale_transform_caps): diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 24302c9ec2..be6cb4ce70 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -387,26 +387,16 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL); - gst_caps_merge_structure (ret, structure); - structure = gst_caps_get_structure (ret, 0); + gst_caps_merge_structure (ret, gst_structure_copy (structure)); /* if pixel aspect ratio, make a range of it */ if ((par = gst_structure_get_value (structure, "pixel-aspect-ratio"))) { - GstCaps *copy; - - GstStructure *cstruct; - - /* copy input PAR first, this is the prefered PAR */ - gst_structure_set_value (structure, "pixel-aspect-ratio", par); - - /* then make a copy with a fraction range as a second choice */ - copy = gst_caps_copy (ret); - cstruct = gst_caps_get_structure (copy, 0); - gst_structure_set (cstruct, + gst_structure_set (structure, "pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - /* and append */ - gst_caps_append (ret, copy); + gst_caps_merge_structure (ret, structure); + } else { + gst_structure_free (structure); } GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret);