Your "H264ServerMediaSubsession::createNewStreamSource()” function needs to 
create a *new* “H264FramedSource” object each time it’s called.  You can’t 
create just one of those objects in advance, and try to reuse it.  So this code 
is wrong:

> H264ServerMediaSubsession::H264ServerMediaSubsession(UsageEnvironment& env, 
> Boolean reuseFirstSource) :
>    OnDemandServerMediaSubsession(env, reuseFirstSource)
> {
>    mFramedSource = H264FramedSource::createNew(env);
> }
> 
> H264ServerMediaSubsession::~H264ServerMediaSubsession() {
>    Medium::close(mFramedSource);
> }
> 
> FramedSource* H264ServerMediaSubsession::createNewStreamSource(unsigned 
> /*clientSessionId*/, unsigned& estBitrate) {
>    estBitrate = 500; // kbps, estimate
> 
>    // Create a framer for the Video Elementary Stream:
>    return H264VideoStreamDiscreteFramer::createNew(envir(), mFramedSource);
> }


You should not be creating (or destroying) “H264FramedSource” objects in your 
“H264ServerMediaSubsession” constructor (or destructor).  Instead, you create a 
"H264FramedSource” object in your 
"H264ServerMediaSubsession::createNewStreamSource()” function.  (It will get 
destroyed automatically when it’s no longer needed.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to