Created
April 30, 2015 11:32
-
-
Save saghul/c3d6a915398bea3b3ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: jni/opus/pj_sources/pj_opus.c | |
=================================================================== | |
--- jni/opus/pj_sources/pj_opus.c (revision 2470) | |
+++ jni/opus/pj_sources/pj_opus.c (working copy) | |
@@ -666,7 +666,7 @@ | |
unsigned char toc; | |
const unsigned char *raw_frames[48]; | |
short size[48]; | |
- int payload_offset, samples_per_frame; | |
+ int err, payload_offset, samples_per_frame; | |
unsigned i; | |
PJ_ASSERT_RETURN(frame_cnt, PJ_EINVAL); | |
@@ -673,11 +673,17 @@ | |
opus = (struct opus_private*) codec->codec_data; | |
- *frame_cnt = opus_packet_parse(pkt, pkt_size, | |
+ err = opus_packet_parse(pkt, pkt_size, | |
&toc, | |
raw_frames, | |
size, | |
&payload_offset); | |
+ if (err <= 0) { | |
+ PJ_LOG(4, (THIS_FILE, "Error parsing Opus packet: %s", opus_strerror(err))); | |
+ *frame_cnt = 0; | |
+ return opus_to_pjsip_error_code(err); | |
+ } | |
+ *frame_cnt = (unsigned) err; | |
samples_per_frame = opus_packet_get_samples_per_frame(pkt, opus->externalFs); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment