summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-03-10 21:19:53 +0200
committerAlexander Larsson <alexl@redhat.com>2010-03-24 15:23:20 +0100
commit77f6d705419034c8b191b13a66947a15ec8c4927 (patch)
tree8283b88b7569d994a2d98d2437cf635565d05626 /client
parentd2edac47cd24103203405586e867b0bc038474e8 (diff)
spice: client: fix handling of top down images in video streams
Top down streams arrive from x11-qxl driver.
Diffstat (limited to 'client')
-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 60e22fc..f303f57 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -129,8 +129,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;
}
@@ -334,16 +335,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);