diff projects/scope/render.cpp @ 133:04b1678614c9 scope-refactoring

Using moving average for clock detection during synchronization seems to be working better but audio gets worse and worse
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 27 Aug 2015 03:33:32 +0100
parents e24c531220ee
children e77e2e712fbc
line wrap: on
line diff
--- a/projects/scope/render.cpp	Thu Aug 27 01:42:04 2015 +0100
+++ b/projects/scope/render.cpp	Thu Aug 27 03:33:32 2015 +0100
@@ -54,7 +54,7 @@
 	static int count=0;
 //	if((count&262143)==0){
 //	static int nextCall=160000;
-	if( ((count&(16384-1))==0 /*&& count>200000*/)){
+	if( ((count&(2047-1))==0 /*&& count>200000*/)){
 //		rt_printf("b %d\n", count);
 		clockSynchronizer.update(networkSend.getTimestamp(), receiveAudio0.getTimestamp(), receiveAudio0.getLastTime());
 //		nextCall=count+100000;
@@ -64,8 +64,8 @@
 //		clockSynchronizer.update(networkSend.getTimestamp(), receiveAudio0.getTimestamp(), receiveAudio0.getLastTime());
 //	}
 	if(count==0){
-		gAudioCodec->setAudioSamplingRate(44080);
-		printf("startHread\n");
+		gAudioCodec->setAudioSamplingRate( 44101);
+		rt_printf("startHread\n");
 		ReceiveAudioThread::startThread();
 	}
 	for(unsigned int n = 0; n < context->audioFrames; n++) {