summaryrefslogtreecommitdiffstats
path: root/video/fmt-conversion.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 18:04:16 +0100
committerwm4 <wm4@nowhere>2013-12-21 20:50:11 +0100
commit64278128d8d5315a19da6d319517c48fa97da3f4 (patch)
tree9e85fdaf3397101a81c3bd7acc835dc4b787fff6 /video/fmt-conversion.c
parent5beedf1967f93ad4edfb6d1dd2edf9f4660a5afe (diff)
downloadmpv-64278128d8d5315a19da6d319517c48fa97da3f4.tar.bz2
mpv-64278128d8d5315a19da6d319517c48fa97da3f4.tar.xz
video/fmt-conversion.c: remove unknown pixel format messages
This removes the messages printed on unknown pixel format messages. Passing a mp_log to them would be too messy. Actually, this is a good change, because in the past we often had trouble with these messages printed too often (causing terminal spam etc.), and printing warnings or error messages on the caller sides is much cleaner. vd_lavc.c had a change earlier to print an error message if a decoder outputs an unsupported pixel format.
Diffstat (limited to 'video/fmt-conversion.c')
-rw-r--r--video/fmt-conversion.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c
index e79ce4d29d..6726ceacf8 100644
--- a/video/fmt-conversion.c
+++ b/video/fmt-conversion.c
@@ -20,7 +20,6 @@
#include <libavutil/avutil.h>
#include "config.h"
-#include "common/msg.h"
#include "video/img_format.h"
#include "fmt-conversion.h"
@@ -203,15 +202,11 @@ enum AVPixelFormat imgfmt2pixfmt(int fmt)
if (fmt == IMGFMT_NONE)
return AV_PIX_FMT_NONE;
- int i;
- enum AVPixelFormat pix_fmt;
- for (i = 0; conversion_map[i].fmt; i++)
+ for (int i = 0; conversion_map[i].fmt; i++) {
if (conversion_map[i].fmt == fmt)
- break;
- pix_fmt = conversion_map[i].pix_fmt;
- if (pix_fmt == AV_PIX_FMT_NONE)
- mp_msg(MSGT_GLOBAL, MSGL_V, "Unsupported format %s\n", vo_format_name(fmt));
- return pix_fmt;
+ return conversion_map[i].pix_fmt;
+ }
+ return AV_PIX_FMT_NONE;
}
int pixfmt2imgfmt(enum AVPixelFormat pix_fmt)
@@ -219,15 +214,9 @@ int pixfmt2imgfmt(enum AVPixelFormat pix_fmt)
if (pix_fmt == AV_PIX_FMT_NONE)
return IMGFMT_NONE;
- int i;
- for (i = 0; conversion_map[i].pix_fmt != AV_PIX_FMT_NONE; i++)
+ for (int i = 0; conversion_map[i].pix_fmt != AV_PIX_FMT_NONE; i++) {
if (conversion_map[i].pix_fmt == pix_fmt)
- break;
- int fmt = conversion_map[i].fmt;
- if (!fmt) {
- const char *fmtname = av_get_pix_fmt_name(pix_fmt);
- mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %s (%d)\n",
- fmtname ? fmtname : "INVALID", pix_fmt);
+ return conversion_map[i].fmt;
}
- return fmt;
+ return 0;
}