[Live-devel] Simulation and packet loss, part two

Antonio Tirri antoniotirri at libero.it
Sat Mar 3 17:44:44 PST 2007


Hi, i tried to substitute the code:

#ifdef TEST_LOSS
     if ((our_random()%10) != 0) // simulate 10% packet loss #####
#endif


with the code:

//#ifdef TEST_LOSS
     if (((double)our_random()%10000)/10000.0 <= 0.8) // simulate 10% packet loss #####
//#endif


where 0.8 is (1-0.2), where 0.2 is the packet loss rate(in this case 20%)

But my compiler (Visual C++ 6.0) gives me this error:


MultiFramedRTPSink.cpp
MultiFramedRTPSink.cpp(352) : error C2296: '%' : illegal, left operand
has type 'double'
NMAKE : fatal error U1077: '"C:\Programmi\Microsoft Visual
Studio\VC98\bin\cl"' : return code '0x2'
Stop.
Error executing NMAKE. 


How can i edit the code in order to introduce the packet loss rate in correct way?

Thanks a lot,
Antonio Tirri







Ross Finlayson ha scritto:
>> For my thesis, i have to study the effect of packet loss on a MPEG video
>> recived during a streaming session. I thinked to execute locally both
>> Live555MediaServer and VLC client.
>> Is it possibile to edit the live555MediaServer, in order to implement a
>> packet loss model during streaming of a MPEG video? What file i have to
>> edit?
>>     
>
> Search for "TEST_LOSS" in the file 
> "liveMedia/MultiFramedRTPSink.cpp".  There you'll see code (#ifdef'd 
> out, by default) that simulates 10% packet loss (upon transmission). 
> I suggest using that code (changing it, as appropriate, to simulate a 
> particular desired packet loss rate).
>   



More information about the live-devel mailing list