diff options
author | Torsten Jager <t.jager@gmx.de> | 2014-04-19 14:47:30 +0200 |
---|---|---|
committer | Torsten Jager <t.jager@gmx.de> | 2014-04-19 14:47:30 +0200 |
commit | 6007ead2292eb39d5c666373c038a1d99056f81a (patch) | |
tree | 8b7dfe63fcc74d11434062c6489d2e4664e4cde3 /src/video_out/video_out_raw.c | |
parent | d099d82407531daf75c3f36cbb14758d2af7cdfe (diff) | |
download | xine-lib-6007ead2292eb39d5c666373c038a1d99056f81a.tar.gz xine-lib-6007ead2292eb39d5c666373c038a1d99056f81a.tar.bz2 |
Avoid optimizer warnings on clut conversion.
The same code is not always warned about (vo_fb was, xshm was not).
The gcc manpage says type punning is allowed via unions only,
but this would mean either breaking the API, or using slow
workarounds. Anyway, this here seems to be the least invasive way.
Diffstat (limited to 'src/video_out/video_out_raw.c')
-rw-r--r-- | src/video_out/video_out_raw.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c index 47f290dc9..4ca8b536a 100644 --- a/src/video_out/video_out_raw.c +++ b/src/video_out/video_out_raw.c @@ -106,18 +106,22 @@ typedef struct { static void raw_overlay_clut_yuv2rgb(raw_driver_t *this, vo_overlay_t *overlay, raw_frame_t *frame) { int i; - clut_t* clut = (clut_t*) overlay->color; + uint32_t *rgb; if (!overlay->rgb_clut) { - for ( i=0; i<sizeof(overlay->color)/sizeof(overlay->color[0]); i++ ) { - *((uint32_t *)&clut[i]) = this->ovl_yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, clut[i].y, clut[i].cb, clut[i].cr); + rgb = overlay->color; + for (i = sizeof (overlay->color) / sizeof (overlay->color[0]); i > 0; i--) { + clut_t *yuv = (clut_t *)rgb; + *rgb++ = this->ovl_yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, yuv->y, yuv->cb, yuv->cr); } overlay->rgb_clut++; } + if (!overlay->hili_rgb_clut) { - clut = (clut_t*) overlay->hili_color; - for ( i=0; i<sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { - *((uint32_t *)&clut[i]) = this->ovl_yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, clut[i].y, clut[i].cb, clut[i].cr); + rgb = overlay->hili_color; + for (i = sizeof (overlay->color) / sizeof (overlay->color[0]); i > 0; i--) { + clut_t *yuv = (clut_t *)rgb; + *rgb++ = this->ovl_yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, yuv->y, yuv->cb, yuv->cr); } overlay->hili_rgb_clut++; } |