From eb2166c97d1c58a4a5e43c8be29085ac5cdbfdc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 10 May 2010 14:52:15 +0200 Subject: [PATCH] videoscale: Set input width/height if the output caps don't have any width or height --- gst/videoscale/gstvideoscale.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index e76463d512..f11873ea66 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -336,7 +336,7 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL); /* if pixel aspect ratio, make a range of it */ - if (gst_structure_get_value (structure, "pixel-aspect-ratio")) { + if (gst_structure_has_field (structure, "pixel-aspect-ratio")) { gst_structure_set (structure, "pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); } @@ -565,9 +565,7 @@ gst_video_scale_fixate_caps (GstBaseTransform * base, GstPadDirection direction, /* we have both PAR but they might not be fixated */ if (from_par && to_par) { gint from_w, from_h, from_par_n, from_par_d, to_par_n, to_par_d; - gint count = 0, w = 0, h = 0; - guint num, den; /* from_par should be fixed */ @@ -663,11 +661,15 @@ gst_video_scale_fixate_caps (GstBaseTransform * base, GstPadDirection direction, if (gst_structure_get_int (ins, "width", &width)) { if (gst_structure_has_field (outs, "width")) { gst_structure_fixate_field_nearest_int (outs, "width", width); + } else { + gst_structure_set (outs, "width", G_TYPE_INT, width, NULL); } } if (gst_structure_get_int (ins, "height", &height)) { if (gst_structure_has_field (outs, "height")) { gst_structure_fixate_field_nearest_int (outs, "height", height); + } else { + gst_structure_set (outs, "height", G_TYPE_INT, height, NULL); } } }