linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-users] issue with oRTP library using liblinphone iOS SDK


From: Ryan Martin
Subject: [Linphone-users] issue with oRTP library using liblinphone iOS SDK
Date: Sat, 28 Apr 2018 14:03:04 +0100

Hello,

I’m having some issues with an iOS application I am currently building using the LibLinphone iOS SDK. I am using the oRTP library within the SDK to receive an RTP stream from a Raspberry Pi and play this back on the iOS device. I am running on an iPad mini iOS 9.3.5. My code using the oRTP library is very similar to the rtprecv.c example included within the oRTP library. I’ll include this below:

    RtpSession *session;
    unsigned char buffer[160];
    int err;
    uint32_t ts=0;
    int stream_received=0;
    int have_more;
    bool_t adapt=TRUE;

    /* init the lib */

    ortp_init();
    ortp_scheduler_init();

    signal(SIGINT,stop_handler);
    session=rtp_session_new(RTP_SESSION_SENDRECV);
    rtp_session_set_scheduling_mode(session,FALSE);
    rtp_session_set_blocking_mode(session,FALSE);
    rtp_session_set_local_addr(session,"0.0.0.0",3550, 3551);
    rtp_session_enable_adaptive_jitter_compensation(session,adapt);
    rtp_session_set_jitter_compensation(session,40);
    rtp_session_set_payload_type(session,0);
    rtp_session_signal_connect(session,"ssrc_changed",(RtpCallback)ssrc_cb,0);
    rtp_session_signal_connect(session,"ssrc_changed",(RtpCallback)rtp_session_reset,0);

    while(cond)
    {
        have_more=1;
        while (have_more){
            err= rtp_session_recv_with_ts(session, buffer, 160, ts, &have_more);
            if (err>0) stream_received=1;
            /* this is to avoid to write to disk some silence before the first RTP packet is returned*/
            if ((stream_received) && (err>0)) {
                
//this is where I will write the buffer to audio output

            }

            

        }

        

        /* Follow the RFC, payload 0 has 8kHz reference rate */
        ts+= frame_size * 8000 / sample_rate;
    }

The first issue was found when running this code with 

session=rtp_session_new(RTP_SESSION_RECVONLY);

Xcode gives an lldb error with "Thread 1: EXC_BAD_ACCESS (code=1, address=0x8)” given on the line err= rtp_session_recv_with_ts(session, buffer, 160, ts, &have_more);

if I change the session to RTP_SESSION_SENDRECV I no longer get this error. Instead I now get Thread 1: signal SIGABRT and:

malloc: *** error for object 0x16b22e04: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

Again, this happens when calling rtp_session_recv_with_ts(session, buffer, 160, ts, &have_more);

If anyone can point me in the right direction with this I’d greatly appreciate it.

Many thanks,

Ryan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]