Patent ID: 7280156

Claim:
A method for synchronizing the presentation of video frames and/or audio frames generated by processing a data stream comprising time stamps indicating instants of presentation of the frames, the method comprising the steps of: calculating a current value of deviation between the presentation instant indicated by a time stamp undergoing processing and a time indicated by a local reference clock during the processing of the time stamp; storing the current value of deviation in a register following values of deviation corresponding to previously processed time stamps; calculating a variance of an ordered set of deviation values stored in the register coming after a reference deviation value, the set of deviation values comprising at least the current value of deviation, and comparing the variance with a predetermined variance threshold; if the variance is greater than the variance threshold, selecting the current value of deviation as new value of reference deviation; and if the variance is less than the variance threshold, calculating an average of the deviation values of the set of deviation values and comparing the average with a determined average threshold, and if the absolute value of the average is greater than the average threshold, initializing the local reference clock to an instantaneous value corresponding to the presentation instant indicated by the time stamp undergoing processing and the current value of deviation is selected as new value of reference deviation, or if the absolute value of the average is less than the average threshold, adjusting the presentation of the frames in such a way as to reduce the deviation between the presentation instant indicated by the time stamp undergoing processing and the time indicated by the local reference clock during the processing of the time stamp.