File fix_freerdp2_detection.patch of Package vlc-beta

--- a/configure.ac
+++ b/configure.ac
@@ -2009,7 +2009,7 @@ PKG_ENABLE_MODULES_VLC([VNC], [vnc], [li
 
 dnl  RDP/Remote Desktop access module
 dnl
-PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
+PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp2 >= 1.0.1], (RDP/Remote Desktop client support) )
 
 dnl
 dnl AVFoundation
--- a/modules/access/rdp.c
+++ b/modules/access/rdp.c
@@ -144,6 +144,7 @@ static void desktopResizeHandler( rdpCon
     vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context;
     demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys;
     rdpGdi *p_gdi = p_context->gdi;
+    unsigned bytesPerPixel;
 
     if ( p_sys->es )
     {
@@ -153,6 +154,26 @@ static void desktopResizeHandler( rdpCon
 
     /* Now init and fill es format */
     vlc_fourcc_t i_chroma;
+#if defined(FREERDP_VERSION_MAJOR) && FREERDP_VERSION_MAJOR == 2
+    switch( p_gdi->dstFormat )
+    {
+        default:
+            msg_Dbg( p_vlccontext->p_demux, "unhandled dstFormat %x bpp", p_gdi->dstFormat);
+        case PIXEL_FORMAT_BGR16:
+            i_chroma = VLC_CODEC_RGB16;
+            bytesPerPixel = 16;
+            break;
+        case PIXEL_FORMAT_BGR24:
+            i_chroma = VLC_CODEC_RGB24;
+            bytesPerPixel = 24;
+            break;
+        case PIXEL_FORMAT_BGRA32:
+            i_chroma = VLC_CODEC_RGB32;
+            bytesPerPixel = 32;
+            break;
+    }
+#else
+    bytesPerPixel = p_gdi->bytesPerPixel;
     switch( p_gdi->bytesPerPixel )
     {
         default:
@@ -166,6 +187,7 @@ static void desktopResizeHandler( rdpCon
             i_chroma = VLC_CODEC_RGB32;
             break;
     }
+#endif
     es_format_t fmt;
     es_format_Init( &fmt, VIDEO_ES, i_chroma );
 
@@ -176,7 +198,7 @@ static void desktopResizeHandler( rdpCon
     fmt.video.i_height = p_gdi->height;
     fmt.video.i_frame_rate_base = 1000;
     fmt.video.i_frame_rate = 1000 * p_sys->f_fps;
-    p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * p_gdi->bytesPerPixel;
+    p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * bytesPerPixel;
 
     if ( p_sys->p_block )
         p_sys->p_block = block_Realloc( p_sys->p_block, 0, p_sys->i_framebuffersize );
@@ -252,6 +274,12 @@ static bool postConnectHandler( freerdp
     p_instance->update->BeginPaint = beginPaintHandler;
     p_instance->update->EndPaint = endPaintHandler;
 
+#if defined(FREERDP_VERSION_MAJOR) && FREERDP_VERSION_MAJOR == 2
+    if ( p_instance->settings->ColorDepth > 16 )
+        gdi_init( p_instance, PIXEL_FORMAT_XRGB32);
+    else
+        gdi_init( p_instance, PIXEL_FORMAT_RGB16);
+#else
     gdi_init( p_instance,
                 CLRBUF_16BPP |
 #if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \
@@ -259,6 +287,7 @@ static bool postConnectHandler( freerdp
                 CLRBUF_24BPP |
 #endif
                 CLRBUF_32BPP, NULL );
+#endif
 
     desktopResizeHandler( p_instance->context );
     return true;