[Live-devel] Live555 EventLoop crash

Ross Finlayson finlayson at live555.com
Wed Dec 14 10:41:12 PST 2011


> Now, after streaming a number of frames to the client, I get the following warning (the actual byte counts vary)
> StreamParser::afterGettingBytes() warning: read 9828 bytes; expected no more than 4142

That error message indicates that your input source object did not set "fFrameSize" properly.  In particular, it set it to a value greater than "fMaxSize" - bad!

A data source object *must* check "fMaxSize" before delivering data and setting "fFrameSize".

In particular, it needs to do something like this (note: This code taken from "liveMedia/DeviceSource.cpp"):

  unsigned newFrameSize = THE_FRAME_SIZE_THAT_YOU_WANT_TO_DELIVER;

  // Deliver the data here:
  if (newFrameSize > fMaxSize) {
    fFrameSize = fMaxSize;
    fNumTruncatedBytes = newFrameSize - fMaxSize;
  } else {
    fFrameSize = newFrameSize;
  }
  gettimeofday(&fPresentationTime, NULL); // If you have a more accurate time - e.g., from an encoder - then use that instead.
  // If the device is *not* a 'live source' (e.g., it comes instead from a file or buffer), then set "fDurationInMicroseconds" here.
  memmove(fTo, newFrameDataStart, fFrameSize);


> Shortly after that I get a SIGSEGV and my server crashes somewhere in the Event loop.
> I think that my previous pipe-using version was self-synchronising and you could never write enough data to the pipe to keep the receiving thread busy. This version will write frames much quicker and I seem to be hitting the BANK_SIZE limit.
> Any advice appreciated, David
>  
>  
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel

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

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


More information about the live-devel mailing list