[FFmpeg-cvslog] HTTP playback is broken due to 59d96941f0285a501989d5f2c9b69be0a1393ed5

Nicolas George nicolas.george at normalesup.org
Wed Apr 20 17:41:38 CEST 2011


Le primidi 1er floréal, an CCXIX, avcoder a écrit :
> HTTP need read+write even if you just open/read a HTTP url

Yes, for the underlying TCP connection.

> set the IO flag to AVIO_FLAG_READ

Well, we want to read from HTTP, that is correct.

> but in http.c: static int http_open_cnx(URLContext *h)
> err = ffurl_open(&hd, buf, AVIO_FLAG_READ_WRITE);
> we need read+write

Still correct.

> int ffurl_read(URLContext *h, unsigned char *buf, int size)
> {
>     if (h->flags & AVIO_FLAG_WRITE)
>         return AVERROR(EIO);

This test is obviously wrong.

> -        av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf);
> +        av_log(s, AV_LOG_ERROR, "Cannot open connection %s\n", buf);

Completely unrelated cosmetic change.

> -    if (!(h->flags & AVIO_FLAG_WRITE))
> +    if (!(h->flags & (AVIO_FLAG_WRITE | AVIO_FLAG_READ_WRITE)))

The whole point to have AVIO_FLAG_READ_WRITE == AVIO_FLAG_READ |
AVIO_FLAG_WRITE is to avoid that.

A read-write stream is a stream on which we can read and write, thus, read
and write are boolean properties of the streams, and read-write is just the
logical conjunction of these flags.

> -    if (flags & AVIO_FLAG_WRITE)
> +    if (flags & (AVIO_FLAG_WRITE | AVIO_FLAG_READ_WRITE))

Ditto.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20110420/c8ae0966/attachment.asc>


More information about the ffmpeg-cvslog mailing list