I analysized Audio/Video synchronization (Raw/RTP/UDP, not TS/RTP/UDP).
and I know, using RTCP SR, Audio timestamp ->NTP,and Video timestamp->NTP。
So Audio and Video can synchronize on a timebase.
VLC has its systemclock(gettimeday(), as a timebase?), but when to play using NTP?
my understanding is when (a Video Frame's) NTP+ (end to end)delay=(now)gettimeday(),play the video Frame. Is this right?
Thanks very much!
in the (Ross Finlayson <finlayson@live555.com>,Derk-Jan Hartman <hartman@videolan.org>) mail, I find this part:
Perhaps the solution would be for VLC to maintain an offset - for each RTP stream
between the PTS that it reports and 'wall clock time'. I.e., do something like (pseudocode):
{
int64_t ptsToUse;
int64_t ptsWallClockOffset = 0;
bool haveSeenFirstValidPTS = false;
if (!haveSeenFirstValidPTS && tk->sub->rtpSource()->hasBeenSynchronizedUsingRTCP())
{
/* This is the first RTCP-synched reported PTS => set "ptsWallClockOffset" */
ptsWallClockOffset = gettimeofday() - reportedPTS;
haveSeenFirstValidPTS = true;
}
ptsToUse = reportedPTS + ptsWallClockOffset;
}