[Live-devel] Packet Loss simulation

Ross Finlayson finlayson at live.com
Wed Jan 14 12:04:33 PST 2004


>I'm currently using Live.com + Mplayer and I'd like to know if it would be 
>possible to simulate packet loss with it and if that's the case, which 
>source file should I modify ?

Marc,

The easiest place to do this is in the function
         MultiFramedRTPSource::networkReadHandler
(in the file "liveMedia/MultiFramedRTPSource.cpp").  This is where incoming 
RTP packets are first processed.

You can simulate packet loss by adding the following *immediately after* 
line 209:

         if (!bPacket->fillInData(source->fRTPInterface)) break; // line 
209 (existing code)
         if (/* I choose to simulate packet loss*/) break; // your new code

>I'd also like to capture the rtp timestamps of the received packet and I'd 
>just like to know which source file I should see in order to get these infos.

In the same source file ("liveMedia/MultiFramedRTPSource.cpp"), a few lines 
down (currently line 215), you'll see the following:

         unsigned rtpTimestamp = 
ntohl(*(unsigned*)(bPacket->data()));ADVANCE(4);

After this, you can log "rtpTimestamp".

I hope this helps.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list