From 730cd815d325ea2a75d0afeac2876edc7a1e2aa8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 22 Feb 2021 15:48:16 -0500 Subject: [PATCH] Add frame format to debug logging. Use fix_deprecated_fmt to fix when ctx->fmt is yuvj420p instead of yuv420p --- src/zm_packet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/zm_packet.cpp b/src/zm_packet.cpp index fc2f3bfa4..95ed6b8de 100644 --- a/src/zm_packet.cpp +++ b/src/zm_packet.cpp @@ -165,10 +165,11 @@ int ZMPacket::decode(AVCodecContext *ctx) { #if HAVE_LIBAVUTIL_HWCONTEXT_H #if LIBAVCODEC_VERSION_CHECK(57, 89, 0, 89, 0) - if ( ctx->sw_pix_fmt != in_frame->format ) { - Debug(1, "Have different format %s != %s.", + if ( fix_deprecated_pix_fmt(ctx->sw_pix_fmt) != in_frame->format ) { + Debug(1, "Have different format ctx->pix_fmt %s ?= ctx->sw_pix_fmt %s in_frame->format %s.", av_get_pix_fmt_name(ctx->pix_fmt), - av_get_pix_fmt_name(ctx->sw_pix_fmt) + av_get_pix_fmt_name(ctx->sw_pix_fmt), + av_get_pix_fmt_name(static_cast(in_frame->format)) ); #if 0 if ( target_format == AV_PIX_FMT_NONE and ctx->hw_frames_ctx and (image->Colours() == 4) ) {