<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>> So, I suggest adding, to your server code, code that compares the value of ‘fPresentationTime” computed your new way,</p>
<p>> with the value that would be computed by calling “gettimeofday()”, and print out the difference</p>
<div id="signature">Thanks, Ross. I assume you mean, if the new presentation time becomes different from wall clock time by a large amount, eg more than 1 second, I should reallign fPresentationTime with wall clock time, like this</div>
<div> </div>
<div> if (fPresentationTime.tv_sec == 0 && fPresentationTime.tv_usec == 0)<br /> {<br /> gettimeofday(&fPresentationTime, NULL);<br /> INFO("setPresentationTime: %ld.%06ld\n", fPresentationTime.tv_sec, fPresentationTime.tv_usec);<br /> }<br /> else<br /> {<br /> // Increment by the sample time<br /> unsigned uSeconds = fPresentationTime.tv_usec + (unsigned)(1000000.0/fMaxFps);<br /> fPresentationTime.tv_sec += uSeconds/1000000;<br /> fPresentationTime.tv_usec = uSeconds%1000000;</div>
<div><br /> //check for basic alignment with 'wall clock' time<br /> struct timeval wallclocktime;<br /> gettimeofday(&wallclocktime, NULL);<br /> if ((wallclocktime.tv_sec > fPresentationTime.tv_sec + 1) ||<br /> (fPresentationTime.tv_sec > wallclocktime.tv_sec + 1) )<br /> { //we have drifted too far from wall clock time so need to realign<br /> fPresentationTime.tv_sec = wallclocktime.tv_sec;<br /> fPresentationTime.tv_usec = wallclocktime.tv_usec;<br /> INFO("Realigning PresentationTime with wall-clock time: %ld.%06ld\n", fPresentationTime.tv_sec, fPresentationTime.tv_usec);<br /> }</div>
<div> }</div>
<div>This seems to work but will need more testing. VLC seems to be very sensitive to presentation time jumps or anomalies.</div>
<div> </div>
<div> </div>
</body></html>