Problem of A/V Sync

Hi All,
I am developing a small media player to stream the a/v file from my local
server using RTP etc. ,But i am getting problem in A/V syncronization.
Can anybody have any idea about this …or anybody have any test code like
FFPLAY.c from where i could get solution of this.

Thanx in advance
Ajay Gautam