RTMP connector teller approach

This commit is contained in:
Thulinma 2010-11-07 21:50:15 +01:00
parent ea588b0791
commit d9fd90e36f

View file

@ -23,8 +23,7 @@ int main(){
//first timestamp set //first timestamp set
firsttime = getNowMS(); firsttime = getNowMS();
int lastcheck = getNowMS(); int teller = 0;
int rightnow = 0;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Doing handshake...\n"); fprintf(stderr, "Doing handshake...\n");
@ -44,9 +43,10 @@ int main(){
#endif #endif
while (!ferror(stdin) && !ferror(stdout)){ while (!ferror(stdin) && !ferror(stdout)){
//only parse input from stdin if available or not yet init'ed //only parse input from stdin if available or not yet init'ed
rightnow = getNowMS(); //rightnow = getNowMS();
if ((!ready4data || (snd_cnt - snd_window_at >= snd_window_size)) && (rightnow - lastcheck > 100)){ teller++;
lastcheck = rightnow; if ((!ready4data || (snd_cnt - snd_window_at >= snd_window_size)) && (teller > 15)){
teller = 0;
parseChunk(); parseChunk();
fflush(stdout); fflush(stdout);
} }