Some handlers of media events republish the event, i.e. change epub keeping data and type and other. Example is vidstream_event_cb in vid_port.c.It again calls pjmedia_event_publish.
The problem is pjmedia_event_publish change epub in event It affects on event_mgr_distribute_event, called by original pjmedia_event_publish. Because event->epub has changed, condition (sub->epub == ev->epub || !sub->epub) can succeed for another sub, i.e call_media_on_event in pjsua_media.c.
The way to solve it is to copy event in vidstream_event_cb(see patch) or to do it in pjmedia_event_publish
diff --git a/libs/pjproject/pjmedia/src/pjmedia/vid_port.c b/libs/pjproject/pjmedia/src/pjmedia/vid_port.c index d7b9ecb..b934e1a 100644 --- a/libs/pjproject/pjmedia/src/pjmedia/vid_port.c +++ b/libs/pjproject/pjmedia/src/pjmedia/vid_port.c @@ -919,9 +919,10 @@ static pj_status_t vidstream_event_cb(pjmedia_event *event, void *user_data) { pjmedia_vid_port *vp = (pjmedia_vid_port*)user_data; - + pjmedia_event new_event; + pj_memcpy(&new_event, event, sizeof(*event)); /* Just republish the event to our client */ - return pjmedia_event_publish(NULL, vp, event, 0); + return pjmedia_event_publish(NULL, vp, &new_event, 0); } static pj_status_t client_port_event_cb(pjmedia_event *event,
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org