OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 BottleNeckModel *BN_data) | 55 BottleNeckModel *BN_data) |
56 { | 56 { |
57 const int HeaderSize = 35; | 57 const int HeaderSize = 35; |
58 int HeaderRate; | 58 int HeaderRate; |
59 | 59 |
60 HeaderRate = HeaderSize * 8 * FS / current_framesamples; /* bits/s */ | 60 HeaderRate = HeaderSize * 8 * FS / current_framesamples; /* bits/s */ |
61 | 61 |
62 /* everything in samples */ | 62 /* everything in samples */ |
63 BN_data->sample_count = BN_data->sample_count + current_framesamples; | 63 BN_data->sample_count = BN_data->sample_count + current_framesamples; |
64 | 64 |
65 BN_data->arrival_time += ((packet_size + HeaderSize) * 8 * FS) / (bottleneck +
HeaderRate); | 65 BN_data->arrival_time += static_cast<uint32_t>( |
| 66 ((packet_size + HeaderSize) * 8 * FS) / (bottleneck + HeaderRate)); |
66 BN_data->send_time += current_framesamples; | 67 BN_data->send_time += current_framesamples; |
67 | 68 |
68 if (BN_data->arrival_time < BN_data->sample_count) | 69 if (BN_data->arrival_time < BN_data->sample_count) |
69 BN_data->arrival_time = BN_data->sample_count; | 70 BN_data->arrival_time = BN_data->sample_count; |
70 | 71 |
71 BN_data->rtp_number++; | 72 BN_data->rtp_number++; |
72 } | 73 } |
73 | 74 |
74 void get_arrival_time2(int current_framesamples, | 75 void get_arrival_time2(int current_framesamples, |
75 int current_delay, | 76 int current_delay, |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 fclose(inp); | 827 fclose(inp); |
827 fclose(outp); | 828 fclose(outp); |
828 fclose(outbits); | 829 fclose(outbits); |
829 | 830 |
830 if ( testCE == 1) { | 831 if ( testCE == 1) { |
831 WebRtcIsacfix_FreeInternal(ISAC_main_inst); | 832 WebRtcIsacfix_FreeInternal(ISAC_main_inst); |
832 } | 833 } |
833 WebRtcIsacfix_Free(ISAC_main_inst); | 834 WebRtcIsacfix_Free(ISAC_main_inst); |
834 return 0; | 835 return 0; |
835 } | 836 } |
OLD | NEW |