From 513d2e24abff6de1b35b2471a57ce1361686e6de Mon Sep 17 00:00:00 2001 From: chenshijun <csj_sky@126.com> Date: 星期六, 29 六月 2019 16:21:15 +0800 Subject: [PATCH] 修改解码gb28181的bug --- csrc/wrapper.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/csrc/wrapper.cpp b/csrc/wrapper.cpp index 7894fa2..321a66a 100644 --- a/csrc/wrapper.cpp +++ b/csrc/wrapper.cpp @@ -84,8 +84,9 @@ auto dec_ctx = in->getCodecContext(); if(bridge_)delete bridge_; - scale_w_ = scale_w_ > dec_ctx->width ? dec_ctx->width : scale_w_; - scale_h_ = scale_h_ > dec_ctx->height ? dec_ctx->height : scale_h_; + scale_w_ = scale_w_ == 0 || scale_w_ > dec_ctx->width ? dec_ctx->width : scale_w_; + scale_h_ = scale_h_ == 0 || scale_h_ > dec_ctx->height ? dec_ctx->height : scale_h_; + AVPixelFormat pix_fmt = AV_PIX_FMT_BGR24; bridge_ = new cvbridge( dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, -- Gitblit v1.8.0