]> git.sesse.net Git - vlc/commitdiff
vdpau: improve decoder capability checks messages
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 25 Jul 2013 16:35:32 +0000 (19:35 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 25 Jul 2013 16:35:32 +0000 (19:35 +0300)
modules/hw/vdpau/avcodec.c

index 7bb4a30f9aa72ab409dd98420c7bcb5f485f9cd4..0f3414c39feb70feee9a5c8494034a9157f2e2c3 100644 (file)
@@ -297,32 +297,40 @@ static int Open(vlc_va_t *va, int codec, const es_format_t *fmt)
 
     /* Check capabilities */
     VdpBool support;
-    uint32_t lvl, mb, width, height;
+    uint32_t l, mb, w, h;
 
     if (vdp_video_surface_query_capabilities(sys->vdp, sys->device,
-              VDP_CHROMA_TYPE_420, &support, &width, &height) != VDP_STATUS_OK)
+              VDP_CHROMA_TYPE_420, &support, &w, &h) != VDP_STATUS_OK)
         support = VDP_FALSE;
-    if (!support || width < fmt->video.i_width || height < fmt->video.i_height)
+    if (!support)
     {
-        msg_Err(va, "video surface not supported: %s %ux%u",
-                 "YUV 4:2:0", fmt->video.i_width, fmt->video.i_height);
+        msg_Err(va, "video surface format not supported: %s", "YUV 4:2:0");
+        goto error;
+    }
+    msg_Dbg(va, "video surface limits: %"PRIu32"x%"PRIu32, w, h);
+    if (w < fmt->video.i_width || h < fmt->video.i_height)
+    {
+        msg_Err(va, "video surface above limits: %ux%u",
+                fmt->video.i_width, fmt->video.i_height);
         goto error;
     }
-    msg_Dbg(va, "video surface supported maximum: %s %"PRIu32"x%"PRIu32,
-            "YUV 4:2:0", width, height);
 
     if (vdp_decoder_query_capabilities(sys->vdp, sys->device, profile,
-                        &support, &lvl, &mb, &width, &height) != VDP_STATUS_OK)
+                                   &support, &l, &mb, &w, &h) != VDP_STATUS_OK)
         support = VDP_FALSE;
-    if (!support || (int)lvl < level
-     || width < fmt->video.i_width || height < fmt->video.i_height)
+    if (!support)
+    {
+        msg_Err(va, "decoder profile not supported: %u", profile);
+        goto error;
+    }
+    msg_Dbg(va, "decoder profile limits: level %"PRIu32" mb %"PRIu32" "
+            "%"PRIu32"x%"PRIu32, l, mb, w, h);
+    if ((int)l < level || w < fmt->video.i_width || h < fmt->video.i_height)
     {
-        msg_Err(va, "decoding profile not supported: %"PRIu32".%d %ux%u",
-                profile, lvl, fmt->video.i_width, fmt->video.i_height);
+        msg_Err(va, "decoder profile above limits: level %d %ux%u",
+                level, fmt->video.i_width, fmt->video.i_height);
         goto error;
     }
-    msg_Dbg(va, "decoding profile supported maximum: %"PRIu32".%"PRIu32" mb %"
-            PRIu32", %"PRIu32"x%"PRIu32, profile, lvl, mb, width, height);
 
     const char *infos;
     if (vdp_get_information_string(sys->vdp, &infos) != VDP_STATUS_OK)