<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19400"><LINK rel=stylesheet 
href="BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}"></HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV><FONT size=2 face=Verdana>
<DIV><FONT size=2 face=Verdana>Hi</FONT></DIV>
<DIV> </DIV>
<DIV>   I am using live555 to support mp4 file that with h264 and 
aac.when vlc play the mp4 file automation the audio and vedio can 
synchronization .If I click the progress bar to jump to a special position the 
audio and vedio can not synchronization .What can I do to resolve the 
problem.Thank you.</DIV>
<DIV> </DIV>
<DIV>In the subsession I rewrite the seekStreamSource like this:</DIV>
<DIV> </DIV>
<DIV>
<DIV>void FfmpegH264ServerMediaSubsession</DIV>
<DIV>::seekStreamSource(FramedSource* inputSource, double& seekNPT, double /*streamDuration*/, u_int64_t& /*numBytes*/) {</DIV>
<DIV>  H264VideoStreamFramer* framer = (H264VideoStreamFramer*)inputSource;</DIV>
<DIV>     framer->flushInput();</DIV>
<DIV></DIV>
<DIV>  // "inputSource" is a filter; its input source is the original elem stream source:</DIV>
<DIV>     FfmpegDemuxedElementaryStream* elemStreamSource</DIV>
<DIV>    = (FfmpegDemuxedElementaryStream*)(((FramedFilter*)inputSource)->inputSource());</DIV>
<DIV></DIV>
<DIV>  // Next, get the original source demux:</DIV>
<DIV>  FfmpegDemux& sourceDemux = elemStreamSource->sourceDemux();</DIV>
<DIV></DIV>
<DIV>  // and flush its input buffers:</DIV>
<DIV>  sourceDemux.FlushInput();</DIV>
<DIV></DIV>
<DIV>  sourceDemux.seekStreamSource(seekNPT);</DIV>
<DIV></DIV>
<DIV>}</DIV></DIV>
<DIV> </DIV>
<DIV>
<DIV>void FfmpegDemux::seekStreamSource(double seekNPT) {</DIV>
<DIV>av_seek_frame(format_ctx_, -1, seekNPT * 1000 * 1000, AVSEEK_FLAG_BACKWARD); //timestamp is usec</DIV>
<DIV>}</DIV></DIV>
<DIV> </DIV></FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana>2013-03-18 
</FONT></DIV><FONT size=2 face=Verdana>
<HR style="WIDTH: 122px; HEIGHT: 2px" align=left SIZE=2>

<DIV><FONT color=#c0c0c0 size=2 face=Verdana><SPAN>kingaceck</SPAN> 
</FONT></DIV></FONT></BODY></HTML>