refine seek code in demux thread