diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-06-22 18:47:29 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-06-22 18:47:29 +0000 |
commit | dd4c4eb0397a77c84ca6818e2073b374bef79dd1 (patch) | |
tree | 0263518a75c376717cc68c4b73681e847f5ef708 /pjmedia | |
parent | 9f837639562ef282625d862ec223ee585038147a (diff) |
Handle error reported by transport
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@538 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index 38891225..9c8d3fbb 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -695,6 +695,12 @@ static void on_rx_rtp( pjmedia_stream *stream, pj_status_t status; + /* Check for errors */ + if (bytes_read < 0) { + LOGERR_((stream->port.info.name.ptr, "RTP recv() error", -bytes_read)); + return; + } + /* Update RTP and RTCP session. */ status = pjmedia_rtp_decode_rtp(&channel->rtp, pkt, bytes_read, &hdr, &payload, &payloadlen); @@ -822,6 +828,13 @@ static void on_rx_rtcp( pjmedia_stream *stream, const void *pkt, pj_ssize_t bytes_read) { + /* Check for errors */ + if (bytes_read < 0) { + LOGERR_((stream->port.info.name.ptr, "RTCP recv() error", + -bytes_read)); + return; + } + pjmedia_rtcp_rx_rtcp(&stream->rtcp, pkt, bytes_read); } |