diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2011-06-20 03:54:49 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2011-06-20 03:54:49 +0000 |
commit | 3eb3a07542e7cb413cffb8f5825d90deafcc38a2 (patch) | |
tree | 9d1c89bd853f53eed0fa6a9e381bc67337fcc7a1 /pjlib-util/src | |
parent | 30a674ea7ca83e616455d21dfc71a15594dd5bfe (diff) |
Re #1308:
- Updated pcap parser component to skip trailer bytes that may exist in some network layers (was raising assertion).
- Updated pcaputil app to allow dynamic payload type codecs.
- Updated pcaputil app to be able to play decoded frames directly to audio device, instead of writing to WAV file.
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3588 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib-util/src')
-rw-r--r-- | pjlib-util/src/pjlib-util/pcap.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pjlib-util/src/pjlib-util/pcap.c b/pjlib-util/src/pjlib-util/pcap.c index e0a86fa8..bf45b714 100644 --- a/pjlib-util/src/pjlib-util/pcap.c +++ b/pjlib-util/src/pjlib-util/pcap.c @@ -368,8 +368,20 @@ PJ_DEF(pj_status_t) pj_pcap_read_udp(pj_pcap_file *file, *udp_payload_size = sz; + // Some layers may have trailer, e.g: link eth2. /* Check that we've read all the packets */ - PJ_ASSERT_RETURN(sz_read == rec_incl, PJ_EBUG); + //PJ_ASSERT_RETURN(sz_read == rec_incl, PJ_EBUG); + + /* Skip trailer */ + while (sz_read < rec_incl) { + sz = rec_incl - sz_read; + status = read_file(file, &tmp.eth, &sz); + if (status != PJ_SUCCESS) { + TRACE_((file->obj_name, "Error reading trailer: %d", status)); + return status; + } + sz_read += sz; + } return PJ_SUCCESS; } |