[Live-devel] Problems with MediaSession::initiateByMediaType()

Kamil Dobkowski kamildobk at poczta.onet.pl
Mon Sep 13 02:54:28 PDT 2010


Hi,

I noticed a strange effect when calling initiateByMediaType() more than once during session setup. 
In my application I call setup methods in the following order:

...
pSession->initiateByMediaType( "video/H264" );
pClient->setupMediaSubsession();
pSession->initiateByMediaType( "audio/PCMU" );
pClient->setupMediaSubsession();
pClient->playMediaSession();
...

and the problem is that during the first call an audio session is initiated, its session socket is created 
and a local port is stored in fClientPortNum - but immediately after that this session is deinitiated ( as
it is not "video/H264" ), and all sockets are closed. In the next step a video session is initiated and the
system assigns exactly the same port to it ( it is ok because all previously open sockets are already 
closed ). When I call  initiateByMediaType( "audio/PCMU" ) an audio session is initiated once again,
but now it binds explicitly to fClientPortNum which is the same port as used in a video session !  The 
system has no problem with it as SO_REUSEADDR is set on both sockets ( and Windows allows
multiple sockets to be bound to one address, which is slightly different behaviour as in Unix, I think ),
Windows delivers all incoming packets only to one of these sockets, so I hear no audio ( or I see no video ).  
It happens occasionally, but it is dangerous as everything looks ok, no errors are returned while, in fact,
one media session is idle.

Regards,
Kamil Dobkowski


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100913/7049834f/attachment-0001.html>


More information about the live-devel mailing list