extra call of media event handler

Антон Шудяев
Wed, May 13, 2020 2:59 PM

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

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