+ if( p_svg->p_rendition == NULL ) {
+ svg_RenderPicture( p_filter, p_svg );
+ if( ! p_svg->p_rendition )
+ {
+ msg_Err( p_filter, "Cannot render SVG" );
+ return VLC_EGENERIC;
+ }
+ }
+ i_width = gdk_pixbuf_get_width( p_svg->p_rendition );
+ i_height = gdk_pixbuf_get_height( p_svg->p_rendition );
+
+ /* Create a new subpicture region */
+ memset( &fmt, 0, sizeof( video_format_t ) );
+ fmt.i_chroma = VLC_CODEC_YUVA;
+ fmt.i_width = fmt.i_visible_width = i_width;
+ fmt.i_height = fmt.i_visible_height = i_height;
+ fmt.i_x_offset = fmt.i_y_offset = 0;
+ fmt.i_sar_num = 1;
+ fmt.i_sar_den = 1;
+
+ p_region->p_picture = picture_NewFromFormat( &fmt );
+ if( !p_region->p_picture )
+ return VLC_EGENERIC;
+ p_region->fmt = fmt;
+
+ p_region->i_x = p_region->i_y = 0;
+ p_y = p_region->p_picture->Y_PIXELS;
+ p_u = p_region->p_picture->U_PIXELS;
+ p_v = p_region->p_picture->V_PIXELS;
+ p_a = p_region->p_picture->A_PIXELS;
+
+ i_pitch = p_region->p_picture->Y_PITCH;
+ i_u_pitch = p_region->p_picture->U_PITCH;
+
+ /* Initialize the region pixels (only the alpha will be changed later) */
+ memset( p_y, 0x00, i_pitch * p_region->fmt.i_height );
+ memset( p_u, 0x80, i_u_pitch * p_region->fmt.i_height );
+ memset( p_v, 0x80, i_u_pitch * p_region->fmt.i_height );
+
+ p_pic = p_region->p_picture;
+
+ /* Copy the data */
+
+ /* This rendering code is in no way optimized. If someone has some time to
+ make it work faster or better, please do.