[Live-devel] Closing injector question

jers at inwind.it jers at inwind.it
Wed Sep 21 20:50:29 PDT 2005


Dear Ross

I did as in your suggestion and it works but it is emerging a new problem.
We have 2 instances of DarwinInjector in the same process.
They are opened at different time to stream 2 independent live mpeg streams
(coming from the same device ... sic).

Well, it seams to work very fine but...
there must be a bug on the socket handling (may be in the hashing
functions).
We get the following error:

BasicTaskScheduler: SingleStep() select() fails: bad file descriptor

I found that the SingleStep function is trying to select() the socket of a
DarwinInjector that has been closed.
This happen in a predictable way with the following sequence of events:

Start the injection of the first stream (in our implementation, this
injector uses the soketId 10)
Start the injection of the second stream (in our implementation, this
injector uses the soketId 11)
Close the first injector (the soket 10 is now closed)
Close the second injector (the socket 11 is now closed)
Start the second injector (now it takes the socket 10)
Start the first injector ((now it takes the socket 11)

Now, if you close the second injector, the socket 10 is closed (and of
course the 11th is still open) but in the TaskScheduler there is still
active the fd 10 while has been removed the 11th. This is the cause of the
program termination.

Of course, we can talk of first and second injector because there are 2
different set of

RTCPInstance, MPEG4ESVideoRTPSink, MPEG4VideoStreamFramer, VideoSource
.....

Each of them is created once and configured according to their future use
(by the injector)

My dubt is: am I doing something wrong, or is there a bug?

Thank you again for your help.

Jers


> 
> >so, if I understand, you say that the right sequence should be:
> >
> >videoSink->stopPlaying()
> >close(injector); // DarwinInjector Object
> 
> Yes.
> 
> 
> >and when I want to restart:
> >
> >videoSink->startPlaying()
> >injector = DarwinInjector::CreateNew(...)
> >injector->addStream(videoSink, videoRTCP);
> >injector->setDestination(...)
> 
> The call to "videoSink->startPlaying()" should probably come last here.
> 
> >Is it enought? I mean, what about the RTCPInstance, 
> >rtcpGroupsockVideo, rtpGroupsockVideo objects?
> >Will they stay quiet without problems (timeout...)?
> 
> I think so, as long as you don't close "videoSink".
> 
> 
> 	Ross Finlayson
> 	Live Networks, Inc. (LIVE.COM)
> 	<http://www.live.com/>
> 
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live.com
> http://lists.live.com/mailman/listinfo/live-devel
> 




More information about the live-devel mailing list