summaryrefslogtreecommitdiffstats
path: root/video/image_writer.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/image_writer.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/image_writer.c')
-rw-r--r--video/image_writer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/image_writer.c b/video/image_writer.c
index 7e725fe729..e921cb7995 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -107,6 +107,11 @@ static int write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp)
avctx->width = image->w;
avctx->height = image->h;
avctx->pix_fmt = imgfmt2pixfmt(image->imgfmt);
+ if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
+ MP_ERR(ctx, "Image format %s not supported by lavc.\n",
+ mp_imgfmt_to_name(image->imgfmt));
+ goto error_exit;
+ }
if (ctx->writer->lavc_codec == AV_CODEC_ID_PNG) {
avctx->compression_level = ctx->opts->png_compression;
avctx->prediction_method = ctx->opts->png_filter;