[Live-devel] stackoverflow

Jeff Shanab jshanab at smartwire.com
Sat Dec 17 10:51:32 PST 2011


I am missing something fundamental about muxing the audio in with the video. Something to do with timeing.

All my attempts to use a file burned thru the audio and exited even though it was an hour worth of audio and I am making 5 second  .ts clips.

So I created a "SilentAacSource" class from the DeviceSource example and put in it one frame of audio that I return whenever GetNextFrame is called.

This is the code that caused infinit recursion before changing the FramedSource::afterGetting(this) to the recommended task scheduling.

However I ended up with a very rabid burst of video then 5 seconds of video. So I put 30,000 microseconds as the first argument to scheduledDelayedTask and the file size droped from 19MB to 200K and was playable with repeated samples of sound.  I am setting the PTS to current machine time, but the video does not have the same pts.   Do the two streams have to have synced PTS's?

Is GetNextFrame called really fast (every 188 bytes) and it is up to the device to say it doesn't have anything?

The encoded file now plays with sound in VLC but it is still downloaded and ignored by the the mac/ipad

From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Jeff Shanab
Sent: Saturday, December 17, 2011 8:43 AM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] stackoverflow

In my ESSource, a class based on the device source example is the only place I have a similar line, FramedSource::afterGetting(this). Replacing that with envir().taskScheduler().scheduleDelayedTask(0, (TaskFunc*)FramedSource::afterGetting, this) does not help.

However just commenting out the one in MP3FileSource and running that as if I am noin windows works for stopping the stack overflow. But there is no MP3 in the output. I am suspecting this is that the MP3 is not in the file format expected. I am stepping thru it now.

My sink has the continuePlaying architecure. My sinks afterGettingFrame1 ends by calling continuePlaying which is

Boolean MYsink::continuePlaying()
{
            If (fSource == NULL)
                        Return false;

            fSource->getNextFrame(fBuffer,fBufferSize,afterGettingFrame,this,onSourceClosure,this)

            return true;
}

If I was to make the signature compatible with a TaskFunction, would scheduling it for the event loop work?




From: live-devel-bounces at ns.live555.com<mailto:live-devel-bounces at ns.live555.com> [mailto:live-devel-bounces at ns.live555.com]<mailto:[mailto:live-devel-bounces at ns.live555.com]> On Behalf Of Ross Finlayson
Sent: Friday, December 16, 2011 4:13 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] stackoverflow

This can happen, though only if both your input source and your output sink (and any filters in-between) are synchronous.  E.g, if your input source is a file on Windoze (where file reading has to be synchronous), and your output sink is also a file.  (It should *not* happen if your output sink is a "RTPSink".)

The way to overcome this is to find one place in your code (your own code, not the supplied source code!) that calls
            afterGetting(this);
and replace this with:
            envir().taskScheduler().scheduleDelayedTask(0, (TaskFunc*)afterGetting, this);
so that you'll return to the event loop rather than getting into a recursive call.


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

________________________________
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2012.0.1890 / Virus Database: 2108/4684 - Release Date: 12/16/11
________________________________
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2012.0.1890 / Virus Database: 2108/4686 - Release Date: 12/17/11
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111217/c4a2fbbb/attachment-0001.html>


More information about the live-devel mailing list