summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_vaapi.c
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2014-04-19 14:47:30 +0200
committerTorsten Jager <t.jager@gmx.de>2014-04-19 14:47:30 +0200
commit6007ead2292eb39d5c666373c038a1d99056f81a (patch)
tree8b7dfe63fcc74d11434062c6489d2e4664e4cde3 /src/video_out/video_out_vaapi.c
parentd099d82407531daf75c3f36cbb14758d2af7cdfe (diff)
downloadxine-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_vaapi.c')
-rw-r--r--src/video_out/video_out_vaapi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/video_out/video_out_vaapi.c b/src/video_out/video_out_vaapi.c
index 4b480b716..5af03b897 100644
--- a/src/video_out/video_out_vaapi.c
+++ b/src/video_out/video_out_vaapi.c
@@ -2233,18 +2233,22 @@ static int vaapi_ovl_associate(vo_driver_t *this_gen, int format, int bShow) {
static void vaapi_overlay_clut_yuv2rgb(vaapi_driver_t *this, vo_overlay_t *overlay, vaapi_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(this->ovl_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 (this->ovl_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(this->ovl_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 (this->ovl_yuv2rgb, yuv->y, yuv->cb, yuv->cr);
}
overlay->hili_rgb_clut++;
}