[Live-devel] exit(1) in AMRDeinterleavingBuffer
David BERTRAND
bidibulle at operamail.com
Thu Sep 7 09:10:54 PDT 2006
Hi Ross,
When receiving buggy AMR packets, my app enter deliverIncomingFrame() and then exits with return code 1.
The code in AMRDeinterleavingBuffer is the following :
void AMRDeinterleavingBuffer
::deliverIncomingFrame(unsigned frameSize, RawAMRRTPSource* source,
struct timeval presentationTime) {
unsigned char const ILL = source->ILL();
unsigned char const ILP = source->ILP();
unsigned frameIndex = source->frameIndex();
unsigned short packetSeqNum = source->curPacketRTPSeqNum();
// First perform a sanity check on the parameters:
// (This is overkill, as the source should have already done this.)
if (ILP > ILL || frameIndex == 0) {
#ifdef DEBUG
fprintf(stderr, "AMRDeinterleavingBuffer::deliverIncomingFrame() param sanity check failed (%d,%d,%d,%d)\n", frameSize, ILL, ILP, frameIndex);
#endif
exit(1);
}
Actually, it exits because frameIndex=0.
The origin of the problem is some invalid FT (frame type) fields in the AMR packets received, resulting in a mismatch between the expected frame sizes and the real frame sizes. At some time, this leads to (fHead-fTail) equalling zero in getNextEnclosedFrameParameters() call, which itself leads to dataSize=0 in nextEnclosedFrameSize() call, which therefore returns immediately without incrementing the frameIndex.
How can avoid an exit call in AMRAudioRTPSource ? RFC 3267 indicates that any packet containing forbidden FT should be discarded. I guess it is what should be done.
Here is my stderr output when running in DEBUG mode :
RTCPInstance[0x827c500]::RTCPInstance()
schedule(1.925937->1157559526.310532)
RTCPInstance[0x827ded0]::RTCPInstance()
schedule(2.093193->1157559526.478279)
schedule(0.797310->1157559527.115028)
schedule(0.849278->1157559527.336935)
schedule(1.135812->1157559528.253455)
schedule(2.708205->1157559530.045905)
schedule(3.942898->1157559532.200478)
schedule(1.475081->1157559531.522707)
schedule(4.692819->1157559536.220446)
schedule(2.080536->1157559534.288186)
Unpacking 'bandwidth-efficient' payload (33 bytes):
f9:3c:91:17:16:be:66:79:e1:e0:01:e7:af:f0:00:00:00:80:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:
Warning: Unpacking frame 4 of 4: want 39 bits, but only 0 are available!
packetSize: 40, ILL: 0, ILP: 0
TOC entry: F 1, FT 2, Q 0
TOC entry: F 1, FT 14, Q 0
TOC entry: F 1, FT 2, Q 0
TOC entry: F 0, FT 8, Q 1
TOC contains 4 entries (3 non-empty)
Total special header size: 5
AMRBufferedPacket::nextEnclosedFrameSize(): frame #: 0, FT: 2, isWideband: 0 => frameSize: 15 (dataSize: 35)
AMRDeinterleavingBuffer::deliverIncomingFrame(): new interleave group
AMRDeinterleavingBuffer::deliverIncomingFrame(): frameIndex 0 (0,0) put in bank 1, bin 0 (1): size 15, header 0x10, presentationTime 1157559532.532693
AMRBufferedPacket::nextEnclosedFrameSize(): frame #: 1, FT: 14, isWideband: 0 => frameSize: 0 (dataSize: 20)
AMRDeinterleavingBuffer::deliverIncomingFrame(): new interleave group
AMRDeinterleavingBuffer::deliverIncomingFrame(): frameIndex 1 (1,0) put in bank 0, bin 0 (1): size 0, header 0x70, presentationTime 1157559532.552693
AMRDeinterleavingBuffer::retrieveFrame(): from bank 1, bin 0: size 15, header 0x10, presentationTime 1157559532.532693
AMRBufferedPacket::nextEnclosedFrameSize(): frame #: 2, FT: 2, isWideband: 0 => frameSize: 15 (dataSize: 20)
AMRDeinterleavingBuffer::deliverIncomingFrame(): new interleave group
AMRDeinterleavingBuffer::deliverIncomingFrame(): frameIndex 2 (2,0) put in bank 1, bin 0 (1): size 15, header 0x10, presentationTime 1157559532.572693
AMRDeinterleavingBuffer::retrieveFrame(): from bank 0, bin 0: size 0, header 0x78, presentationTime 1157559532.552693
AMRBufferedPacket::nextEnclosedFrameSize(): frame #: 3, FT: 8, isWideband: 0 => frameSize: 5 (dataSize: 5)
AMRDeinterleavingBuffer::deliverIncomingFrame(): new interleave group
AMRDeinterleavingBuffer::deliverIncomingFrame(): frameIndex 3 (3,0) put in bank 0, bin 0 (1): size 5, header 0x44, presentationTime 1157559532.592693
AMRDeinterleavingBuffer::retrieveFrame(): from bank 1, bin 0: size 15, header 0x10, presentationTime 1157559532.572693
Unpacking 'bandwidth-efficient' payload (33 bytes):
f7:3c:10:29:83:28:b4:51:c7:ec:8a:ee:00:e4:57:40:31:40:00:6e:dd:c0:1d:29:48:00:02:18:8b:f1:2b:28:20:
Warning: 254 bits remain unused!
packetSize: 2, ILL: 0, ILP: 0
TOC entry: F 0, FT 14, Q 0
TOC contains 1 entries (0 non-empty)
Total special header size: 2
AMRDeinterleavingBuffer::deliverIncomingFrame() param sanity check failed (0,0,0,0)
--->exit(1)
Thanks,
David
--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com
Powered by Outblaze
More information about the live-devel
mailing list