Commit 5f112496 authored by paalmm's avatar paalmm
Browse files

quickfix

parent b1c5cab5
...@@ -173,6 +173,7 @@ $SIG{TERM} = sub { $uninterrupted=0; # return if $nkill++ < 1; ...@@ -173,6 +173,7 @@ $SIG{TERM} = sub { $uninterrupted=0; # return if $nkill++ < 1;
$SIG{ALRM} = sub { $SIG{ALRM} = sub {
# Writes stats to file if option XML is given. -PMM # Writes stats to file if option XML is given. -PMM
# die "No packets received" if $n_packets < 1; # die "No packets received" if $n_packets < 1;
print "alarmen går ! \n";
$uninterrupted=0; $uninterrupted=0;
if (! $endstream) { # Changed logic 20120706:1007 CDT if (! $endstream) { # Changed logic 20120706:1007 CDT
$endstream=1; $endstream=1;
...@@ -1583,7 +1584,8 @@ sub pkt_stats { ...@@ -1583,7 +1584,8 @@ sub pkt_stats {
$setuptime{$f}=tv_interval ( $tjoined{$f}, $tstart{$f}) * 10**3; $setuptime{$f}=tv_interval ( $tjoined{$f}, $tstart{$f}) * 10**3;
} }
printf "setup $f : %.3f\n", $setuptime{$f} if $opt_debug; printf "setup $f : %.3f\n", $setuptime{$f} if $opt_debug;
alarm($opt_last) if $opt_last; #print "hei hei \n";
#alarm($opt_last) if $opt_last;
} }
} }
$tend{$f} = $tc; $tend{$f} = $tc;
...@@ -1664,22 +1666,21 @@ sub pkt_stats { ...@@ -1664,22 +1666,21 @@ sub pkt_stats {
&burst($f); &burst($f);
} }
if ($opt_period){ if ($opt_period){
my $span=$last_us{$f}-$first_us{$f}; $interval=int($us/10**6 / $opt_period);
my $tmp2 = $span/10**6; if ($interval > $pinterval){
if ($tmp2 > $opt_period){ &mpeg_debug() if $opt_debug;
&mpeg_debug() if $opt_debug; &display_stats() if !$endstream;
&display_stats() if !$endstream; &init_stats($f);
&init_stats($f); $pinterval=$interval;
$pinterval=$interval; $pinterval{$f}=$interval;
$pinterval{$f}=$interval; $endstream = $opt_nperiod && $interval >= $opt_nperiod;
$endstream = $opt_nperiod && $interval >= $opt_nperiod;
} }
$pus=$us;
$psec=$sec;
$pmtime{$f}=$mtime{$f} if $opt_rtp || $opt_crude;
$pseq_num{$f}= $seq_num{$f} if $opt_rtp || $opt_crude;
$pus{$f}=$us;
} }
$pus=$us;
$psec=$sec;
$pmtime{$f}=$mtime{$f} if $opt_rtp || $opt_crude;
$pseq_num{$f}= $seq_num{$f} if $opt_rtp || $opt_crude;
$pus{$f}=$us;
} # of pkt_stats } # of pkt_stats
sub do_math{ sub do_math{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment