Method and apparatus for synchronizing audio and video data
View Patent ↗A system receives a transport stream containing video data and audio data. A determination is made regarding the time required to process the video data contained in the transport stream and the time required to process the audio data contained in the transport stream. The system then determines a difference in time to process the video contained in the transport stream as compared to the audio data contained in the transport stream. Presentation of the audio data is delayed by this difference in time to synchronize presentation of the audio data with presentation of the video data.
1. A method comprising:
receiving a transport stream containing video data and audio data;
determining a time required to process the video data contained in the transport stream;
determining a time required to process the audio data contained in the transport stream;
determining a difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream; and
delaying presentation of the audio data by the difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream.
2. A method as recited in claim 1 , wherein delaying presentation of the audio data by the difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream is performed if the difference in time exceeds a threshold.
3. A method as recited in claim 1 , wherein determining a time required to process the video data contained in the transport stream includes receiving a video presentation delay from a video display software routine.
4. A method as recited in claim 1 , wherein determining a time required to process the video data contained in the transport stream includes calculating a video presentation delay by comparing a presentation time stamp and a system time clock.
5. A method as recited in claim 1 , wherein the method of claim 1 is repeated at periodic intervals.
6. A method as recited in claim 1 , wherein the method of claim 1 is performed for each received frame of video data.
7. A method as recited in claim 1 , wherein delaying presentation of the audio data by the difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream includes storing the audio data in a DMA buffer with a delay that corresponds to the difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream.
8. A method as recited in claim 1 , further comprising decoding the video data received in the transport stream.
9. A method as recited in claim 1 , further comprising decoding the audio data received in the transport stream.
10. A method comprising:
receiving a transport stream containing video data and audio data;
determining a time required to process the video data contained in the transport stream;
determining a time required to process the audio data contained in the transport stream;
determining a difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream;
if the time required to process the video data is greater than the time required to process the audio data, delaying presentation of the audio data by the difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream; and
if the time required to process the audio data is greater than the time required to process the video data, delaying presentation of the video data by the difference in time to process the video data contained in the transport stream as compared to the audio data contained in the transport stream.
11. A method as recited in claim 10 , wherein determining a time required to process the video data contained in the transport stream includes receiving a video presentation delay.
12. A method as recited in claim 10 , wherein determining a time required to process the video data contained in the transport stream includes calculating a video presentation delay by comparing a presentation time stamp and a system time clock.
13. A method as recited in claim 10 , further comprising decoding the video data received in the transport stream.
14. A method as recited in claim 10 , further comprising decoding the audio data received in the transport stream.