emotion - fix empty video data frame update when using vdpau accel
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 2 Mar 2017 06:29:54 +0000 (15:29 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 2 Mar 2017 06:31:07 +0000 (15:31 +0900)
fixes a segfault when using vdpau+gst and where the first frame seems to
be empty/zero.

@fix

src/modules/evas/engines/gl_common/evas_gl_texture.c
src/modules/evas/engines/gl_generic/evas_engine.c

index d8259eb..f4d747e 100644 (file)
@@ -1954,7 +1954,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
    tex->ptv2 = ptv;
 
    // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
-   if (tex->gc->shared->info.unpack_row_length)
+   if ((tex->gc->shared->info.unpack_row_length) && (rows[0] && rows[h]))
      {
         glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
         glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -1973,7 +1973,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
           return;
         _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
      }
-   else
+   else if (rows[0] && rows[h])
      {
         unsigned int y;
         
index 412580e..d0c179e 100644 (file)
@@ -1021,6 +1021,7 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
               im->cs.data = image_data;
            }
          evas_gl_common_image_dirty(im, 0, 0, 0, 0);
+         evas_gl_common_image_update(im->gc, im);
          break;
       default:
          ERR("colorspace %d is not supported here", im->cs.space);