   queueVideo: (pesInfo, doNotReadNext=false) ->
     pendingVideoPesPackets.push pesInfo
     if pendingVideoPesPackets.length is 1
-      timeDiff = @getTimeUntilDTS(pesInfo.pes.DTS) - SETTIMEOUT_ADVANCE_TIME
+      timeDiff = Math.round @getTimeUntilDTS(pesInfo.pes.DTS) - SETTIMEOUT_ADVANCE_TIME
       if timeDiff <= 0
         @consumeVideo doNotReadNext
       else

        if (not doNotReadNext) and (not @checkEnd())
          @readNext()
      else
        timeDiff = @getTimeUntilDTS(pendingAudioPesPackets[0].pes.DTS) - SETTIMEOUT_ADVANCE_TIME
        if timeDiff <= 0
          @consumeAudio doNotReadNext
        else

        if (not doNotReadNext) and (not @checkEnd())
          @readNext()
      else
        timeDiff = Math.round @getTimeUntilDTS(pendingVideoPesPackets[0].pes.DTS) - SETTIMEOUT_ADVANCE_TIME
        if timeDiff <= 0
          @consumeVideo()
        else
