changeset 36442:ee46a4670903

Query codec support first. The filter chain query is more complex. In addition this for the moment avoids a vo_vdpau bug where the query function destroys the old decoder.
author reimar
date Sun, 08 Dec 2013 17:52:23 +0000
parents b75ebb89d803
children 0d52d44ad7b6
files libmpcodecs/vd.c
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd.c	Sun Dec 08 15:07:00 2013 +0000
+++ b/libmpcodecs/vd.c	Sun Dec 08 17:52:23 2013 +0000
@@ -194,21 +194,21 @@
         out_fmt = sh->codec->outfmt[i];
         if (out_fmt == (unsigned int) 0xFFFFFFFF)
             continue;
+        // check (query) if codec really support this outfmt...
+        sh->outfmtidx = j;  // pass index to the control() function this way
+        if (mpvdec->control(sh, VDCTRL_QUERY_FORMAT, &out_fmt) ==
+            CONTROL_FALSE) {
+            mp_msg(MSGT_CPLAYER, MSGL_DBG2,
+                   "vo_debug: codec query_format(%s) returned FALSE\n",
+                   vo_format_name(out_fmt));
+            continue;
+        }
         flags = vf->query_format(vf, out_fmt);
         mp_msg(MSGT_CPLAYER, MSGL_DBG2,
                "vo_debug: query(%s) returned 0x%X (i=%d) \n",
                vo_format_name(out_fmt), flags, i);
         if ((flags & VFCAP_CSP_SUPPORTED_BY_HW)
             || (flags & VFCAP_CSP_SUPPORTED && j < 0)) {
-            // check (query) if codec really support this outfmt...
-            sh->outfmtidx = j;  // pass index to the control() function this way
-            if (mpvdec->control(sh, VDCTRL_QUERY_FORMAT, &out_fmt) ==
-                CONTROL_FALSE) {
-                mp_msg(MSGT_CPLAYER, MSGL_DBG2,
-                       "vo_debug: codec query_format(%s) returned FALSE\n",
-                       vo_format_name(out_fmt));
-                continue;
-            }
             j = i;
             vo_flags = flags;
             if (flags & VFCAP_CSP_SUPPORTED_BY_HW)
@@ -217,10 +217,7 @@
                    && !(flags &
                         (VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_CSP_SUPPORTED))
                    && (out_fmt == IMGFMT_RGB8 || out_fmt == IMGFMT_BGR8)) {
-            sh->outfmtidx = j;  // pass index to the control() function this way
-            if (mpvdec->control(sh, VDCTRL_QUERY_FORMAT, &out_fmt) !=
-                CONTROL_FALSE)
-                palette = 1;
+            palette = 1;
         }
     }
     if (j < 0 && !IMGFMT_IS_HWACCEL(preferred_outfmt)) {