From cbb78eb610be2722c9d397fecbb27c02899e3813 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Sep 2012 12:53:01 +0200 Subject: [PATCH] video-info: don't do alignment on the palette Don't align the palette data. Fixes endless loop when trying to align paletted formats. --- gst-libs/gst/video/video-info.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index e5c43d9..20406dc 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -697,6 +697,10 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align) padded_height = height + align->padding_top + align->padding_bottom; n_planes = GST_VIDEO_INFO_N_PLANES (info); + + if (GST_VIDEO_FORMAT_INFO_HAS_PALETTE (vinfo)) + n_planes--; + do { GST_LOG ("padded dimension %u-%u", padded_width, padded_height); @@ -723,9 +727,6 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align) info->width = width; info->height = height; - if (GST_VIDEO_FORMAT_INFO_HAS_PALETTE (vinfo)) - n_planes--; - for (i = 0; i < n_planes; i++) { gint vedge, hedge, comp; -- 2.7.4