1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00

refine rtmp client, add comments for the dumps_packets()

This commit is contained in:
winlin 2014-07-27 11:57:08 +08:00
parent a645b403c8
commit d0bc0884d1

View file

@ -212,8 +212,13 @@ int SrsMessageQueue::dump_packets(int max_count, SrsSharedPtrMessage** pmsgs, in
av_start_time = last->header.timestamp;
if (count == (int)msgs.size()) {
// the pmsgs is big enough and clear msgs at most time.
msgs.clear();
} else {
// erase some vector elements may cause memory copy,
// maybe can use more efficient vector.swap to avoid copy.
// @remark for the pmsgs is big enough, for instance, SYS_MAX_PLAY_SEND_MSGS 128,
// the rtmp play client will get 128msgs once, so this branch rarely execute.
msgs.erase(msgs.begin(), msgs.begin() + count);
}