# HG changeset patch # User reimar # Date 1386525143 0 # Node ID ee46a4670903ed0b47ba8180dbab0b3267b8d18b # Parent b75ebb89d80318a5f80f904ccc521f857a193997 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. diff -r b75ebb89d803 -r ee46a4670903 libmpcodecs/vd.c --- 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)) {