From 0abb3d251383bcdf22db67e2b26431b7a7b74148 Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 11 八月 2017 14:30:34 +0800
Subject: [PATCH] bug fix

---
 RtspFace/PL_Scale.cpp |   14 +++-----------
 RtspFace/PL_Paint.h   |    2 ++
 RtspFace/PL_Paint.cpp |   10 ++++++++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/RtspFace/PL_Paint.cpp b/RtspFace/PL_Paint.cpp
index acfd90c..cb069dd 100644
--- a/RtspFace/PL_Paint.cpp
+++ b/RtspFace/PL_Paint.cpp
@@ -32,6 +32,12 @@
 #endif
 }
 
+void PLPLContext::clear()
+{
+	cmds.clear();
+	params.clear();
+}
+
 struct PL_Paint_Internal
 {
 	uint8_t* buffer;
@@ -185,7 +191,7 @@
 
 bool plplDraw_Rect_RGB565(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
 {
-    int LTX = plplCtx->params[paramOffset + 0].val_i;
+	int LTX = plplCtx->params[paramOffset + 0].val_i;
     int LTY = plplCtx->params[paramOffset + 1].val_i;
     int RBX = plplCtx->params[paramOffset + 2].val_i;
     int RBY = plplCtx->params[paramOffset + 3].val_i;
@@ -236,7 +242,7 @@
 
 bool plplDraw_Text_RGB565(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
 {
-    int LTX = plplCtx->params[paramOffset + 0].val_i;
+	int LTX = plplCtx->params[paramOffset + 0].val_i;
     int LTY = plplCtx->params[paramOffset + 1].val_i;
     const char* TXT = plplCtx->params[paramOffset + 2].val_s;
     paramOffset += 3;
diff --git a/RtspFace/PL_Paint.h b/RtspFace/PL_Paint.h
index 66ada4c..6a8c402 100644
--- a/RtspFace/PL_Paint.h
+++ b/RtspFace/PL_Paint.h
@@ -61,6 +61,8 @@
 	{}
 
 	~PLPLContext();
+
+	void clear();
 };
 
 struct PL_Paint_Config
diff --git a/RtspFace/PL_Scale.cpp b/RtspFace/PL_Scale.cpp
index bbb6995..7b12875 100644
--- a/RtspFace/PL_Scale.cpp
+++ b/RtspFace/PL_Scale.cpp
@@ -230,18 +230,14 @@
 	PipeMaterial newPm;
 	newPm.type = PipeMaterial::PMT_NONE;
 	newPm.former = this;
-	
-	switch(in->lastPmType)
-	{
-	case PipeMaterial::PMT_BYTES:
+
+	if (in->lastPmType == PipeMaterial::PMT_BYTES)
 	{
 		newPm.type = PipeMaterial::PMT_BYTES;
 		newPm.buffer = in->buffer;
 		newPm.buffSize = in->buffSize;
 	}
-	break;
-	case PipeMaterial::PMT_FRAME:
-	case PipeMaterial::PMT_PM_LIST:
+	else
 	{
 		newPm.type = PipeMaterial::PMT_FRAME;
 		newPm.buffer = &(in->tempFrame);
@@ -251,10 +247,6 @@
 		in->tempFrame.buffSize = in->buffSize;
 		in->tempFrame.width = in->config.toWidth;
 		in->tempFrame.height = in->config.toHeight;
-	}
-	break;
-	default:
-		LOG_ERROR << "Only support PMT_BYTES / PMT_FRAME" << std::endl;
 	}
 
 	pm = newPm;

--
Gitblit v1.8.0