Player optimisation
This commit is contained in:
		
							parent
							
								
									892dfa4e38
								
							
						
					
					
						commit
						e45caad697
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -171,6 +171,7 @@ int main(int argc, char** argv){ | ||||||
|               int ms = JSON::Value(in_out.Received().get().substr(2)).asInt(); |               int ms = JSON::Value(in_out.Received().get().substr(2)).asInt(); | ||||||
|               bool ret = source.seek_time(ms); |               bool ret = source.seek_time(ms); | ||||||
|               lasttime = 0; |               lasttime = 0; | ||||||
|  |               lastTime = 0; | ||||||
|               break; |               break; | ||||||
|             } |             } | ||||||
|             case 'p': { //play
 |             case 'p': { //play
 | ||||||
|  | @ -238,8 +239,8 @@ int main(int argc, char** argv){ | ||||||
|       if (lastTime == 0){ |       if (lastTime == 0){ | ||||||
|         lastTime = now - source.getJSON()["time"].asInt(); |         lastTime = now - source.getJSON()["time"].asInt(); | ||||||
|       } |       } | ||||||
|       if (playing == -1 && playUntil == 0 && source.getJSON()["time"].asInt() > now - lastTime + 2500){ |       if (playing == -1 && playUntil == 0 && source.getJSON()["time"].asInt() > now - lastTime + 1000){ | ||||||
|         std::cerr << (source.getJSON()["time"].asInt() - (now - lastTime)) << " sleepytimes" << std::endl; |         //std::cerr << (source.getJSON()["time"].asInt() - (now - lastTime)) << " ms sleep" << std::endl;
 | ||||||
|         Util::sleep(source.getJSON()["time"].asInt() - (now - lastTime)); |         Util::sleep(source.getJSON()["time"].asInt() - (now - lastTime)); | ||||||
|       } |       } | ||||||
|       if ( playUntil && playUntil < source.getJSON()["time"].asInt()){ |       if ( playUntil && playUntil < source.getJSON()["time"].asInt()){ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Oswald Auguste de Bruin
						Oswald Auguste de Bruin