From 3e52c086bcdeb2293e4a182863bcb984c79315d5 Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 11 八月 2017 18:49:23 +0800
Subject: [PATCH] bug fix for rtsp server
---
RtspFace/PL_RTSPServer2.cpp | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/RtspFace/PL_RTSPServer2.cpp b/RtspFace/PL_RTSPServer2.cpp
index b0235bc..793276a 100644
--- a/RtspFace/PL_RTSPServer2.cpp
+++ b/RtspFace/PL_RTSPServer2.cpp
@@ -129,6 +129,12 @@
}
}
+ int ret = pthread_mutex_lock(_this->in->queue_empty_mutex);
+ if (ret != 0)
+ {
+ LOG_WARN << "pthread_mutex_lock queue_empty_mutex, ret=" << ret << std::endl;
+ }
+
ScopeLocker<pthread_mutex_t>(_this->in->queue_mutex);
if (_this->lastBuffer != nullptr)
@@ -145,7 +151,7 @@
buffer = _this->lastBuffer->buffer;
buffSize = _this->lastBuffer->buffSize;
- LOG_INFO << "DeliverFrameCallback buffSize=" << buffSize << LOG_ENDL;
+ //LOG_INFO << "DeliverFrameCallback buffSize=" << buffSize << LOG_ENDL;
//static size_t f = 0;
//static FILE *pFile = fopen("/data/bb.264", "wb");
//fwrite(buffer, sizeof(char), buffSize, pFile);
@@ -194,6 +200,7 @@
bool PL_RTSPServer2::init(void* args)
{
RTSPServer2_Internal* in = (RTSPServer2_Internal*)internal;
+ in->reset();
if (args)
{
@@ -288,7 +295,7 @@
int ret = pthread_mutex_unlock(in->queue_empty_mutex);
if (ret != 0)
{
- //LOG_WARN << "pthread_mutex_unlock queue_empty_mutex, ret=" << ret << std::endl;
+ LOG_WARN << "pthread_mutex_unlock queue_empty_mutex, ret=" << ret << std::endl;
}
return true;
}
--
Gitblit v1.8.0