changeset 36416:93473818b259

Avoid message spam by not trying formats that will not work. This helps mostly with the formats that support hardware acceleration.
author reimar
date Sat, 16 Nov 2013 08:07:08 +0000
parents 06bdd36f5c46
children 9e68e53481e4
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sat Nov 16 07:54:17 2013 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sat Nov 16 08:07:08 2013 +0000
@@ -622,6 +622,14 @@
     update_configuration(sh, pix_fmt);
     if (!ctx->vo_initialized)
     {
+        int i;
+        // avoid initialization for formats not on the supported
+        // list in the codecs.conf entry.
+        for (i = 0; i < CODECS_MAX_OUTFMT; i++)
+            if (sh->codec->outfmt[i] == ctx->best_csp)
+                break;
+        if (i == CODECS_MAX_OUTFMT)
+            return -1;
         sh->disp_w = width;
         sh->disp_h = height;
         if (!mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, ctx->best_csp))