From 3b71fec6bf5e9bc2c03fc397291b515c5f8eead8 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期一, 13 五月 2019 14:04:33 +0800
Subject: [PATCH] fix bug scale

---
 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