Handle error reported by transport

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@538 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2006-06-22 18:47:29 +00:00
parent 84f45890c4
commit 1b8b0d559c
1 changed files with 13 additions and 0 deletions

View File

@ -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);
}