]> git.sesse.net Git - vlc/commitdiff
Used YUV fallback list in xcb.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 8 Aug 2009 23:35:36 +0000 (01:35 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 8 Aug 2009 23:35:36 +0000 (01:35 +0200)
modules/video_output/xcb/xvideo.c

index 75ce2a5a4fe75332cd8a22811c8bc51080146575..026d9a7116bdfff2a17390debd83f0fe8d1cd70b 100644 (file)
@@ -346,14 +346,20 @@ static int Open (vlc_object_t *obj)
 
         const xcb_xv_image_format_info_t *xfmt;
 
-        /* Video chroma in preference order */
-        const vlc_fourcc_t chromas[] = {
+        /* */
+        const vlc_fourcc_t chromas_default[] = {
             fmt.i_chroma,
             VLC_CODEC_YUYV,
             VLC_CODEC_RGB24,
             VLC_CODEC_RGB15,
+            0
         };
-        for (size_t i = 0; i < sizeof (chromas) / sizeof (chromas[0]); i++)
+        if (vlc_fourcc_IsYUV (fmt.i_chroma))
+            chromas = vlc_fourcc_GetYUVFallback (fmt.i_chroma);
+        else
+            chromas = chromas_default;
+
+        for (size_t i = 0; chromas[i]; i++)
         {
             vlc_fourcc_t chroma = chromas[i];
             xfmt = FindFormat (vd, chroma, &fmt, a->base_id, r, &p_sys->att);