[Live-devel] Stop/restart RTP source

Dong Liu dliu.cn at gmail.com
Mon Nov 2 16:54:29 PST 2009


Hi,

In my project I need to stop and restart receving RTP stream. I'm using the 
following code to do these,

start and restart is the same,

mySink->startPlaying(theRtpSource, afterPlayFun, NULL);
watchVariable=0;
pScheduler->doEventLoop(&watchVariable);

For stop

mySink->stopPlaying();
watchVariable=1; // to terminate event loop

It is kind of working, but the presentation in the function 
afterGettingFrame is off. It actually jumped back in time comparing to the 
presentation time just before stopPlaying was called.

After went through some code, I found I can do,

theRtpSource.receptionStatsDB().removeRecord(theRtpSource.getLastReceivedSSRC())

This seemd fix the presentation problem. But video still seems delayed for.

Am I doing the right thing when doing stop and start the RTP stream? Is 
there anything I'm missing.

Thanks!

Dong


More information about the live-devel mailing list