[Mesa-dev] [PATCH 01/11] vl/video_buffer: fix height of interlaced video buffers

Christian König deathsimple at vodafone.de
Wed Feb 1 15:19:54 PST 2012


Signed-off-by: Christian König <deathsimple at vodafone.de>
---
 src/gallium/auxiliary/vl/vl_video_buffer.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index 021e81e..249124f 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -321,7 +321,7 @@ vl_video_buffer_create(struct pipe_context *pipe,
                        const struct pipe_video_buffer *tmpl)
 {
    const enum pipe_format *resource_formats;
-   struct pipe_video_buffer templat;
+   struct pipe_video_buffer templat, *result;
    bool pot_buffers;
 
    assert(pipe);
@@ -347,11 +347,17 @@ vl_video_buffer_create(struct pipe_context *pipe,
    if (tmpl->interlaced)
       templat.height /= 2;
 
-   return vl_video_buffer_create_ex
+   result = vl_video_buffer_create_ex
    (
       pipe, &templat, resource_formats,
       tmpl->interlaced ? 2 : 1, PIPE_USAGE_STATIC
    );
+
+
+   if (result && tmpl->interlaced)
+      result->height *= 2;
+
+   return result;
 }
 
 struct pipe_video_buffer *
-- 
1.7.5.4



More information about the mesa-dev mailing list