Index: webrtc/modules/audio_coding/codecs/opus/opus_interface.c |
diff --git a/webrtc/modules/audio_coding/codecs/opus/opus_interface.c b/webrtc/modules/audio_coding/codecs/opus/opus_interface.c |
index bcb05966445ba389291e40382fbc16a1a0ac2673..3dab34024cef4b01647a4a7633d38f6dc1d1132f 100644 |
--- a/webrtc/modules/audio_coding/codecs/opus/opus_interface.c |
+++ b/webrtc/modules/audio_coding/codecs/opus/opus_interface.c |
@@ -95,7 +95,11 @@ int WebRtcOpus_Encode(OpusEncInst* inst, |
encoded, |
(opus_int32)length_encoded_buffer); |
- if (res == 1) { |
+ if (res <= 0) { |
minyue-webrtc
2016/07/26 11:52:06
better to do res in similar manner
Alternative 1:
flim-webrtc
2016/07/26 12:22:05
Done.
|
+ return -1; |
+ } |
+ |
+ if (res <= 2) { |
// Indicates DTX since the packet has nothing but a header. In principle, |
// there is no need to send this packet. However, we do transmit the first |
// occurrence to let the decoder know that the encoder enters DTX mode. |
@@ -105,12 +109,10 @@ int WebRtcOpus_Encode(OpusEncInst* inst, |
inst->in_dtx_mode = 1; |
return 1; |
} |
- } else if (res > 1) { |
+ } else { |
inst->in_dtx_mode = 0; |
return res; |
} |
- |
- return -1; |
} |
int16_t WebRtcOpus_SetBitRate(OpusEncInst* inst, int32_t rate) { |