private long buildSize(int durationInSeconds,LinkInfo linfo){
  long result=-1;
  double bitRateSum=0;
switch (linfo.fmt) {
case 5:
    bitRateSum=0.25 + 64d / 1024d;
  break;
case 6:
bitRateSum=0.8 + 64d / 1024d;
break;
case 17:
bitRateSum=0.05 + 24d / 1024d;
break;
case 18:
bitRateSum=0.5 + 96d / 1024d;
break;
case 22:
bitRateSum=2.9 + 192d / 1024d;
break;
case 34:
bitRateSum=0.5 + 128d / 1024d;
break;
case 35:
bitRateSum=1 + 128d / 1024d;
break;
case 36:
bitRateSum=0.17 + 38d / 1024d;
break;
case 37:
bitRateSum=5.9 + 192d / 1024d;
break;
case 38:
bitRateSum=5 + 192d / 1024d;
break;
case 43:
bitRateSum=0.5 + 128d / 1024d;
break;
case 44:
bitRateSum=1 + 128d / 1024d;
break;
case 45:
bitRateSum=2 + 192d / 1024d;
break;
case 46:
bitRateSum=3 + 192d / 1024d;
break;
case 82:
bitRateSum=0.5 + 96d / 1024d;
break;
case 83:
bitRateSum=0.5 + 96d / 1024d;
break;
case 84:
bitRateSum=2.9 + 152d / 1024d;
break;
case 85:
bitRateSum=2.9 + 152d / 1024d;
break;
case 100:
bitRateSum=0.5 + 128d / 1024d;
break;
case 101:
bitRateSum=1 + 192d / 1024d;
break;
case 102:
bitRateSum=2 + 192d / 1024d;
break;
case 133:
bitRateSum=0.3 + 256d / 1024d;
break;
case 134:
bitRateSum=0.4 + 256d / 1024d;
break;
case 135:
bitRateSum=1 + 256d / 1024d;
break;
case 136:
bitRateSum=1.5 + 256d / 1024d;
break;
case 137:
bitRateSum=2.9 + 256d / 1024d;
break;
case 139:
bitRateSum=48d / 1024d;
break;
case 140:
bitRateSum=128d / 1024d;
break;
case 141:
bitRateSum=256d / 1024d;
break;
}
bitRateSum=bitRateSum * 1024 * 1024;
result=(long)(Math.ceil((bitRateSum * durationInSeconds) / 8));
return result;
}

private long buildSize ( int durationInSeconds , LinkInfo linfo ) { long result = - 1 ; double bitRateSum = 0 ; switch ( linfo . fmt ) { case 5 : bitRateSum = 0.25 + 64d / 1024d ; break ; case 6 : bitRateSum = 0.8 + 64d / 1024d ; break ; case 17 : bitRateSum = 0.05 + 24d / 1024d ; break ; case 18 : bitRateSum = 0.5 + 96d / 1024d ; break ; case 22 : bitRateSum = 2.9 + 192d / 1024d ; break ; case 34 : bitRateSum = 0.5 + 128d / 1024d ; break ; case 35 : bitRateSum = 1 + 128d / 1024d ; break ; case 36 : bitRateSum = 0.17 + 38d / 1024d ; break ; case 37 : bitRateSum = 5.9 + 192d / 1024d ; break ; case 38 : bitRateSum = 5 + 192d / 1024d ; break ; case 43 : bitRateSum = 0.5 + 128d / 1024d ; break ; case 44 : bitRateSum = 1 + 128d / 1024d ; break ; case 45 : bitRateSum = 2 + 192d / 1024d ; break ; case 46 : bitRateSum = 3 + 192d / 1024d ; break ; case 82 : bitRateSum = 0.5 + 96d / 1024d ; break ; case 83 : bitRateSum = 0.5 + 96d / 1024d ; break ; case 84 : bitRateSum = 2.9 + 152d / 1024d ; break ; case 85 : bitRateSum = 2.9 + 152d / 1024d ; break ; case 100 : bitRateSum = 0.5 + 128d / 1024d ; break ; case 101 : bitRateSum = 1 + 192d / 1024d ; break ; case 102 : bitRateSum = 2 + 192d / 1024d ; break ; case 133 : bitRateSum = 0.3 + 256d / 1024d ; break ; case 134 : bitRateSum = 0.4 + 256d / 1024d ; break ; case 135 : bitRateSum = 1 + 256d / 1024d ; break ; case 136 : bitRateSum = 1.5 + 256d / 1024d ; break ; case 137 : bitRateSum = 2.9 + 256d / 1024d ; break ; case 139 : bitRateSum = 48d / 1024d ; break ; case 140 : bitRateSum = 128d / 1024d ; break ; case 141 : bitRateSum = 256d / 1024d ; break ; } bitRateSum = bitRateSum * 1024 * 1024 ; result = ( long ) ( Math . ceil ( ( bitRateSum * durationInSeconds ) / 8 ) ) ; return result ; }
upper guess to determine the duration in bytes , using highest bitrate of the stream .
