# HG changeset patch # User reimar # Date 1390505812 0 # Node ID 7d4fa6681d2b233ed458f345eae9def5b8c5c857 # Parent b98f5481ed4128f6cc62ac80478aab1537544775 vd: Make sure we test the preferred format first. Otherwise vd_ffmpeg will always convert 422 to 420 for e.g. ffh246 since it only needs a stride adjustment. diff -r b98f5481ed41 -r 7d4fa6681d2b libmpcodecs/vd.c --- a/libmpcodecs/vd.c Thu Jan 23 19:21:53 2014 +0000 +++ b/libmpcodecs/vd.c Thu Jan 23 19:36:52 2014 +0000 @@ -152,6 +152,7 @@ unsigned int preferred_outfmt) { int i, j; + int only_preferred = 1; unsigned int out_fmt = 0; int screen_size_x = 0; //SCREEN_SIZE_X; int screen_size_y = 0; //SCREEN_SIZE_Y; @@ -189,9 +190,15 @@ } j = -1; - for (i = 0; i < CODECS_MAX_OUTFMT; i++) { + for (i = 0; only_preferred || i < CODECS_MAX_OUTFMT; i++) { int flags; + if (i == CODECS_MAX_OUTFMT) { + i = 0; + only_preferred = 0; + } out_fmt = sh->codec->outfmt[i]; + if (only_preferred && out_fmt != preferred_outfmt) + continue; if (out_fmt == (unsigned int) 0xFFFFFFFF) continue; // check (query) if codec really support this outfmt...