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_opengl.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_opengl.c')
-rw-r--r-- | src/video_out/video_out_opengl.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 093630605..3cb934859 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -1501,23 +1501,23 @@ static void opengl_update_frame_format (vo_driver_t *this_gen, static void opengl_overlay_clut_yuv2rgb(opengl_driver_t *this, vo_overlay_t *overlay, opengl_frame_t *frame) { - int i; - clut_t* clut = (clut_t*) overlay->color; + int i; + uint32_t *rgb; if (!overlay->rgb_clut) { - for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { - *((uint32_t *)&clut[i]) = - frame->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++ = frame->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]) = - frame->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++ = frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, yuv->y, yuv->cb, yuv->cr); } overlay->hili_rgb_clut++; } |