struct ast_format_cap *cap0 = ast_format_cap_alloc_nolock();
struct ast_format_cap *cap1 = ast_format_cap_alloc_nolock();
int unlock_chans = 1;
+ int read_ptime0, read_ptime1, write_ptime0, write_ptime1;
if (!cap0 || !cap1) {
unlock_chans = 0;
goto done;
}
+ read_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, ast_channel_rawreadformat(c0))).cur_ms;
+ read_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, ast_channel_rawreadformat(c1))).cur_ms;
+ write_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, ast_channel_rawwriteformat(c0))).cur_ms;
+ write_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, ast_channel_rawwriteformat(c1))).cur_ms;
+
+ if (read_ptime0 != write_ptime1 || read_ptime1 != write_ptime0) {
+ ast_debug(1, "Packetization differs between RTP streams (%d != %d or %d != %d). Cannot native bridge in RTP\n",
+ read_ptime0, write_ptime1, read_ptime1, write_ptime0);
+ res = AST_BRIDGE_FAILED_NOWARN;
+ goto done;
+ }
+
instance0->glue = glue0;
instance1->glue = glue1;
instance0->chan = c0;