0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

image_writer: improve format conversion logging

This commit is contained in:
sfan5 2023-11-06 13:36:31 +01:00
parent f41805081b
commit 8c751a0d78

View File

@ -552,8 +552,10 @@ static int get_target_format(struct image_writer_ctx *ctx)
int srcfmt = ctx->original_format.id;
int target = get_encoder_format(codec, srcfmt, ctx->opts->high_bit_depth);
if (!target)
if (!target) {
mp_dbg(ctx->log, "Falling back to high-depth format.\n");
target = get_encoder_format(codec, srcfmt, true);
}
if (!target)
goto unknown;
@ -649,7 +651,7 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt,
if (mp_image_params_equal(&p, &image->params))
return mp_image_new_ref(image);
mp_dbg(log, "Will convert image to %s\n", mp_imgfmt_to_name(p.imgfmt));
mp_dbg(log, "will convert image to %s\n", mp_imgfmt_to_name(p.imgfmt));
struct mp_image *src = image;
if (mp_image_crop_valid(&src->params) &&
@ -700,6 +702,8 @@ bool write_image(struct mp_image *image, const struct image_writer_opts *opts,
if (!opts)
opts = &defs;
mp_dbg(log, "input: %s\n", mp_image_params_to_str(&image->params));
struct image_writer_ctx ctx = { log, opts, image->fmt };
bool (*write)(struct image_writer_ctx *, mp_image_t *, const char *) = write_lavc;
int destfmt = 0;