From afd05f71c38303ef724390736a8e50e6ae2afdd6 Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 14 Aug 2015 15:51:02 +0800 Subject: [PATCH] refine code, use size cache for performance issue. --- trunk/src/app/srs_app_source.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index 126b2b1a3..35661bd9c 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -311,7 +311,7 @@ int SrsMessageQueue::dump_packets(int max_count, SrsSharedPtrMessage** pmsgs, in SrsSharedPtrMessage* last = omsgs[count - 1]; av_start_time = last->timestamp; - if (count >= (int)msgs.size()) { + if (count >= nb_msgs) { // the pmsgs is big enough and clear msgs at most time. msgs.clear(); } else {