[Live-devel] [Live-develop] Problems with delete in MediaSink.cpp

Cristiano Belloni belloni at imavis.com
Thu Feb 14 08:49:24 PST 2008


Hi,

I'm streaming videos from an RTSP on demand server with LiveMedia.

I wrote my own "FramedSource" subclass and my own 
"OnDemandServerMediaSubsession" subclass in order to stream frames 
acquired from my live source, rather than from a file.

This solution streams correctly, but when I close my client and it sends 
a TEARDOWN message to the server, the server crashes with SIGABRT and a 
message of "rtspServer: munmap_chunk(): invalid pointer: 0x08193dc0 ***".

Further investigation leads me to locate the offending instruction in 
MediaSink.cpp OutPacketBuffer::~OutPacketBuffer() method. In particular, 
the signal is generated when I try to execute the instruction  delete[] 
fBuf;

The method is called respectively by  ~H263plusVideoRTPSink destroyer 
function, called by MediaLookupTable::remove method.

Why does it happen? the only interaction I have with 
H263plusVideoRTPSink is when i create it in createNewRTPSink, defined in 
my OnDemandServerMediaSubsession subclass, like this:

RTPSink* EncH263plusVideoFileServerMediaSubsession::
createNewRTPSink(Groupsock* rtpGroupsock,
                                  unsigned char rtpPayloadTypeIfDynamic,
                                  FramedSource* inputSource) {
  return H263plusVideoRTPSink::createNew(envir(), rtpGroupsock, 
rtpPayloadTypeIfDynamic);
}

Is it the correct way to create the sink? And what could cause the 
corrupt or double-delete in ~OutPacketBuffer?

Thanks in advance,
Best Regards,

Cristiano.
-- 
Belloni Cristiano
Imavis Srl.
www.imavis.com <http://www.imavis.com>
belloni at imavis.com <mailto://belloni@imavis.com>


More information about the live-devel mailing list