[FFmpeg-devel] rtsp/rdt streaming from bbc (was: ask for advie of doing Qualification task -- M95 Playback System)

Steven Woolley woobert
Wed Apr 1 18:35:19 CEST 2009

HI Ronald,

> Is it streaming over UDP? I've been told the iPhone blocks UDP
> traffick altogether. To force TCP, add a line "if (lower_transport !=
> RTSP_LOWER_TRANSPORT_TCP) return 1;" at the top of
> make_setup_request() in libavformat/rtsp.c, that will force TCP as
> lower transport and should make any form of RTSP work on the iPhone.

Thanks for the suggestion... but it's still not working (so it's not just
the UDP transport).

Here's where it's "hanging"..

in rtsp.c:

static int url_readbuf(URLContext *h, unsigned char *buf, int size)


    int ret, len;

    len = 0;

    while (len < size) {

        ret = url_read(h, buf+len, size-len); //<----- HERE

        if (ret < 1)

            return ret;

        len += ret;


    return len;


which is hanging here in avio.c:

int url_read(URLContext *h, unsigned char *buf, int size)


    int ret;

    if (h->flags & URL_WRONLY)

        return AVERROR(EIO);

    ret = h->prot->url_read(h, buf, size); // <----- HERE

    return ret;


So, I'm out of my element here to be sure... but in order to get libmms to
work on the iPhone I had to add a socket timeout to get it to not block (in
a similar fashion).... basically this (in the read from socket function
before doing the actual read):

struct timeval tv;

tv.tv_sec = 20;

tv.tv_usec = 0;

if (setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) {

      printf("error setting socket read timeout\n");


So, is this something that maybe needs to be done with the rtsp code


More information about the ffmpeg-devel mailing list