Chromium Code Reviews

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/opus_interface.c

Issue 2693453003: Fix nr of bytes sent to Opus decoder in DTX mode (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 95 matching lines...)
106 } 106 }
107 107
108 if (res <= 2) { 108 if (res <= 2) {
109 // Indicates DTX since the packet has nothing but a header. In principle, 109 // Indicates DTX since the packet has nothing but a header. In principle,
110 // there is no need to send this packet. However, we do transmit the first 110 // there is no need to send this packet. However, we do transmit the first
111 // occurrence to let the decoder know that the encoder enters DTX mode. 111 // occurrence to let the decoder know that the encoder enters DTX mode.
112 if (inst->in_dtx_mode) { 112 if (inst->in_dtx_mode) {
113 return 0; 113 return 0;
114 } else { 114 } else {
115 inst->in_dtx_mode = 1; 115 inst->in_dtx_mode = 1;
116 return 1; 116 return res;
117 } 117 }
118 } 118 }
119 119
120 inst->in_dtx_mode = 0; 120 inst->in_dtx_mode = 0;
121 return res; 121 return res;
122 } 122 }
123 123
124 int16_t WebRtcOpus_SetBitRate(OpusEncInst* inst, int32_t rate) { 124 int16_t WebRtcOpus_SetBitRate(OpusEncInst* inst, int32_t rate) {
125 if (inst) { 125 if (inst) {
126 return opus_encoder_ctl(inst->encoder, OPUS_SET_BITRATE(rate)); 126 return opus_encoder_ctl(inst->encoder, OPUS_SET_BITRATE(rate));
(...skipping 347 matching lines...)
474 return 0; 474 return 0;
475 } 475 }
476 476
477 for (n = 0; n < channels; n++) { 477 for (n = 0; n < channels; n++) {
478 if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1))) 478 if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1)))
479 return 1; 479 return 1;
480 } 480 }
481 481
482 return 0; 482 return 0;
483 } 483 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine