# HG changeset patch # User reimar # Date 1346256386 0 # Node ID 387485e3956aa11875734dd748626b10cc929689 # Parent 5dcaa3aa2c7b3ea66547637d5589aad1f7b74294 vf_ass: Improve format query. The output format should always match the input format for this filter, and we should set the EOSD capability. This also simplifies adding support for more formats. Patch by Xidorn Quan [quanxunzhen gmail com]. diff -r 5dcaa3aa2c7b -r 387485e3956a libmpcodecs/vf_ass.c --- a/libmpcodecs/vf_ass.c Tue Aug 28 20:47:34 2012 +0000 +++ b/libmpcodecs/vf_ass.c Wed Aug 29 16:06:26 2012 +0000 @@ -75,6 +75,7 @@ if (outfmt == IMGFMT_IF09) return 0; + vf->priv->outfmt = outfmt; vf->priv->outh = height + ass_top_margin + ass_bottom_margin; vf->priv->outw = width; @@ -366,7 +367,7 @@ case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: - return vf_next_query_format(vf, vf->priv->outfmt); + return vf_next_query_format(vf, fmt) | VFCAP_EOSD; } return 0; } @@ -399,10 +400,10 @@ static int vf_open(vf_instance_t *vf, char *args) { int flags; - vf->priv->outfmt = vf_match_csp(&vf->next, fmt_list, IMGFMT_YV12); - if (vf->priv->outfmt) - flags = vf_next_query_format(vf, vf->priv->outfmt); - if (!vf->priv->outfmt || (vf->priv->auto_insert && flags & VFCAP_EOSD)) { + unsigned outfmt = vf_match_csp(&vf->next, fmt_list, IMGFMT_YV12); + if (outfmt) + flags = vf_next_query_format(vf, outfmt); + if (!outfmt || (vf->priv->auto_insert && flags & VFCAP_EOSD)) { uninit(vf); return 0; }