[Live-devel] 答复: empty payload data will be sent in MultiFramedRTPSink

Zhang Qian(张倩) qianzhang at asrmicro.com
Mon Sep 23 21:15:26 PDT 2019


Hi Ross,

Thanks for your reply. Do you mean I just call scheduleDelayedTask if (fFrameSize > 0) as below ?  Seems that it will block the live555 thread...

    if (fFrameSize > 0)
    {
        // Set the 'presentation time':
        gettimeofday(&fPresentationTime, NULL);
        fDurationInMicroseconds = (mCurrentTimeStampUs - mLastTimeStampUs);
        nextTask() = envir().taskScheduler().scheduleDelayedTask(schedule_delayUs,
                 (TaskFunc*)FramedSource::afterGetting, this);
    }
    return;

Thanks.
/Qian

-----邮件原件-----
发件人: live-devel [mailto:live-devel-bounces at us.live555.com] 代表 Ross Finlayson
发送时间: 2019年9月24日 11:34
收件人: LIVE555 Streaming Media - development & use
主题: Re: [Live-devel] empty payload data will be sent in MultiFramedRTPSink



> On Sep 23, 2019, at 7:36 PM, Zhang Qian(张倩) <qianzhang at asrmicro.com> wrote:
> 
>  
> Hi Ross,
>  
> I found it will send RTP packet with empty payload data in function MultiFramedRTPSink::afterGettingFrame1 if frameSize is 0.

That is correct.  These are valid RTP packets; just with no payload.


> How can I avoid this issue?

Don’t set “fFrameSize” to 0.

In other words, in your server code (e.g., in your implementation of “doGetNextFrame()” for your “FramedSource” subclass) don’t call “FramedSource::afterGetting()” unless/until you actually have a (non-zero-length) frame to deliver.  If “doGetNextFrame()”gets called when no frame is currently available to be delivered, then you must simply return, without calling “FramedSource::afterGetting()”.


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


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



More information about the live-devel mailing list