summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-03-10 21:19:53 +0200
committerUri Lublin <uril@redhat.com>2010-03-23 14:27:33 +0200
commit273a460eebb3c2fd93978dff4d1fa0e21a858456 (patch)
treea270575ecc64ce132a9f32870abe6079d2eb91d9
parent3f757b846c829d1f5d75eeedb2c34d3ab34d5a50 (diff)
spice: client: fix handling of top down images in video streams (#576151)spice-client-0.4.2-5.el6
Rebased from RHEL-5: commit de3460c93c941a4456f932a630ca78b73f323b09 Author: Yonit Halperin <yhalperi@redhat.com> Date: Mon Jan 18 13:15:16 2010 +0200 spice: client: fix handling of top down images in video streams (556741) Top down streams arrive from x11-qxl driver.
-rw-r--r--client/display_channel.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index ed8f2c9b..b6696659 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -128,8 +128,9 @@ static inline void yuv420_to_rgb(AVFrame* frame, uint8_t* data, uint32_t width,
ASSERT(width % 2 == 0);
ASSERT(height % 2 == 0);
+ /* turning it to be down to top */
if (top_down) {
- data += stride * height - 1;
+ data += stride * (height - 1);
stride = -stride;
}
@@ -333,16 +334,11 @@ VideoStream::VideoStream(RedClient& client, Canvas& canvas, DisplayChannel& chan
_pixmap.width = src_width;
_pixmap.height = src_height;
- if (top_down) {
- _pixmap.data = _uncompressed_data;
- _pixmap.stride = _stride;
- } else {
#ifdef WIN32
- SetViewportOrgEx(_dc, 0, stream_height - src_height, NULL);
+ SetViewportOrgEx(_dc, 0, stream_height - src_height, NULL);
#endif
- _pixmap.data = _uncompressed_data + _stride * (src_height - 1);
- _pixmap.stride = -_stride;
- }
+ _pixmap.data = _uncompressed_data + _stride * (src_height - 1);
+ _pixmap.stride = -_stride;
set_clip(clip_type, num_clip_rects, clip_rects);