diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-10-06 09:13:27 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-10-06 09:13:27 +0000 |
commit | 3c57b8f96a1e80c810a83375768945aff38c274f (patch) | |
tree | 51839dab91144c9f4512275b9fe0bf7263ee0c10 | |
parent | 08f106d83b062b4d970a90bfec26f00c2411dc90 (diff) |
Misc (re #1370): limit the number of error messages caused by error in send_rtp()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3802 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/src/pjmedia/vid_stream.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pjmedia/src/pjmedia/vid_stream.c b/pjmedia/src/pjmedia/vid_stream.c index 7e60ebcf..eefb1479 100644 --- a/pjmedia/src/pjmedia/vid_stream.c +++ b/pjmedia/src/pjmedia/vid_stream.c @@ -109,6 +109,7 @@ struct pjmedia_vid_stream pj_str_t cname; /**< SDES CNAME */ pjmedia_transport *transport; /**< Stream transport. */ + unsigned send_err_cnt; /**< Send error count. */ pj_mutex_t *jb_mutex; pjmedia_jbuf *jb; /**< Jitter buffer. */ @@ -811,8 +812,14 @@ static pj_status_t put_frame(pjmedia_port *port, frame_out.size + sizeof(pjmedia_rtp_hdr)); if (status != PJ_SUCCESS) { - LOGERR_((channel->port.info.name.ptr, - "Transport send_rtp() error", status)); + enum { COUNT_TO_REPORT = 20 }; + if (stream->send_err_cnt++ == 0) { + LOGERR_((channel->port.info.name.ptr, + "Transport send_rtp() error (repeated %d times)", + status)); + if (stream->send_err_cnt > COUNT_TO_REPORT) + stream->send_err_cnt = 0; + } /* Ignore this error */ } |