Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
branches:nemo:devel:hw:ti:omap4:common
>
gst-plugins-base
> 0038-stridetransform-fix-wrong-stride-with-non-multiple-o.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0038-stridetransform-fix-wrong-stride-with-non-multiple-o.patch of Package gst-plugins-base
From 73e7712c1f139959024e0ff61077b690d43bc9c0 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Wed, 20 Jun 2012 09:30:47 +0000 Subject: [PATCH] stridetransform: fix wrong stride with non multiple of 4 widths Also do not execute code with side effects in asserts-like code. --- gst/stride/gststridetransform.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gst/stride/gststridetransform.c b/gst/stride/gststridetransform.c index 7b9b189..0ff5814 100644 --- a/gst/stride/gststridetransform.c +++ b/gst/stride/gststridetransform.c @@ -525,14 +525,24 @@ gst_stride_transform_set_caps (GstBaseTransform * base, gint width, height; GstVideoFormat in_format, out_format; gint i; + gboolean ok; LOG_CAPS (self, incaps); LOG_CAPS (self, outcaps); - g_return_val_if_fail (gst_video_format_parse_caps_strided (incaps, - &in_format, &self->width, &self->height, &self->in_rowstride), FALSE); - g_return_val_if_fail (gst_video_format_parse_caps_strided (outcaps, - &out_format, &width, &height, &self->out_rowstride), FALSE); + ok = gst_video_format_parse_caps_strided (incaps, + &in_format, &self->width, &self->height, &self->in_rowstride); + g_return_val_if_fail (ok, FALSE); + ok = gst_video_format_parse_caps_strided (outcaps, + &out_format, &width, &height, &self->out_rowstride); + g_return_val_if_fail (ok, FALSE); + + /* Ensure we round up to match what GStreamer expects when no stride + is given */ + if (self->in_rowstride == 0) + self->in_rowstride = GST_ROUND_UP_4 (self->width); + if (self->out_rowstride == 0) + self->out_rowstride = GST_ROUND_UP_4 (width); self->conversion = NULL; self->crop_width = 0; -- 1.7.9.5