[Live-devel] Issue faced with JPEGVideo

Ryan Chong fantasychong at yahoo.com
Thu Jul 21 21:28:20 PDT 2005


I am facing problem with the JPEGVideo (Source and
Sink). When I initialize the
OnDemandServerMediaSubsession  with the
reuseFirstSource set to True, and try to Pause the
stream, it will cause Segmentation Fault.

My team mate and I traced the code, and found that
this happen after the MediaSink::stopPlaying() was

We traced it with gdb on linux, and found the
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1026 (LWP 29706)]
0x08060cfb in JPEGVideoRTPSink::specialHeaderSize ()
(gdb) where
#0  0x08060cfb in JPEGVideoRTPSink::specialHeaderSize
#1  0x0806778f in
MultiFramedRTPSink::isTooBigForAPacket ()
#2  0x080675ea in
MultiFramedRTPSink::afterGettingFrame1 ()
#3  0x0806744a in
MultiFramedRTPSink::afterGettingFrame ()
#4  0x0804fa6d in FramedSource::afterGetting ()
#5  0x080891f1 in AlarmHandler::handleTimeout ()
#6  0x08088866 in DelayQueue::handleAlarm ()
#7  0x0808812f in BasicTaskScheduler::SingleStep ()
#8  0x08087be5 in BasicTaskScheduler0::doEventLoop ()
#9  0x0804a58b in thread (data=0x80c7f68) at
#10 0x400220ba in pthread_start_thread () from
#11 0x40022101 in pthread_start_thread_event () from

We notice that in the
JPEGVideoRTPSink::specialHeaderSize() function, it
does the following:
 unsigned JPEGVideoRTPSink::specialHeaderSize() const
// Our source is known to be a JPEGVideoSource
JPEGVideoSource* source = (JPEGVideoSource*)fSource; 

unsigned headerSize = 8; // by default

if (curFragmentationOffset() == 0 && source->qFactor()
>= 128) {

The call to the source->qFactor() was the source to
the SegFault, since the MediaSink::stopPlaying() will
assign the source to NULL. (Line 80 to 91 in the

I have tested this on various vesion of liveMedia
code, which were downloaded on 6th, 12th and 15th
July. I also test it on the latest make on today, 22nd
July. The result is same.

Wish this could be solved.


Start your day with Yahoo! - make it your home page 

More information about the live-devel mailing list