<!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>Hi</FONT></DIV>
<DIV> </DIV>
<DIV>I use live555 to transport h264 and aac stream from mp4 file.At the client 
when I play it automatic (don't clike the progress bar) the video and 
audio can  <SPAN class=word>synchronization</SPAN>.</DIV>
<DIV> </DIV>
<DIV>But when I clicked on the progress bar (can call seekStreamSource(...) ) 
the video and audio can not <SPAN class=word>synchronization.The 
audio lag . I try to resolve it for many days,but I </SPAN></DIV>
<DIV><SPAN class=word></SPAN> </DIV>
<DIV><SPAN class=word>cant by now.Can you give me your suggestions .Tank 
you very very very much!</SPAN></DIV>
<DIV><SPAN class=word></SPAN> </DIV>
<DIV>
<DIV>void FfmpegDemux::seekStreamSource(double seekNPT) {</DIV>
<DIV>//format_ctx_->streams[this->server_demux_->audio_stream_id_]->time_base</DIV>
<DIV>int64_t  pos = (int64_t)(seekNPT * AV_TIME_BASE);</DIV>
<DIV>pos = av_rescale_q(pos, AV_TIME_BASE_Q,format_ctx_->streams[this->server_demux_->audio_stream_id_]->time_base);</DIV>
<DIV><EM><STRONG>av_seek_frame</STRONG></EM>(format_ctx_, this->server_demux_->audio_stream_id_, pos, AVSEEK_FLAG_ANY); //timestamp is usec AVSEEK_FLAG_ANY AVSEEK_FLAG_BACKWARD</DIV>
<DIV></DIV>
<DIV>//av_seek_frame(format_ctx_, -1, seekNPT*1000*1000, AVSEEK_FLAG_BACKWARD); //timestamp is usec</DIV>
<DIV></DIV>
<DIV>// if(seekNPT>0)</DIV>
<DIV>// 
avcodec_flush_buffers(format_ctx_->streams[this->server_demux_->audio_stream_id_]->codec);</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>}</DIV></DIV>
<DIV> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana>2013-04-01 
</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>