# HG changeset patch # User michael # Date 1076775932 0 # Node ID 0d74e8abcb3d0e06e2f8d63ab77341ff33d75e07 # Parent efd9dfe4f504df461257ce59a6db731d114ae435 avio patch by (Gildas Bazin ) diff -r efd9dfe4f504 -r 0d74e8abcb3d aviobuf.c --- a/aviobuf.c Wed Feb 11 02:28:34 2004 +0000 +++ b/aviobuf.c Sat Feb 14 16:25:32 2004 +0000 @@ -429,7 +429,7 @@ return -ENOMEM; if (init_put_byte(s, buffer, buffer_size, - (h->flags & URL_WRONLY) != 0, h, + (h->flags & URL_WRONLY || h->flags & URL_RDWR), h, url_read_packet, url_write_packet, url_seek_packet) < 0) { av_free(buffer); return -EIO; @@ -547,7 +547,8 @@ int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags) { return init_put_byte(s, buf, buf_size, - (flags & URL_WRONLY) != 0, NULL, NULL, NULL, NULL); + (flags & URL_WRONLY || flags & URL_RDWR), + NULL, NULL, NULL, NULL); } /* return the written or read size */ diff -r efd9dfe4f504 -r 0d74e8abcb3d file.c --- a/file.c Wed Feb 11 02:28:34 2004 +0000 +++ b/file.c Sat Feb 14 16:25:32 2004 +0000 @@ -37,7 +37,9 @@ strstart(filename, "file:", &filename); - if (flags & URL_WRONLY) { + if (flags & URL_RDWR) { + access = O_CREAT | O_TRUNC | O_RDWR; + } else if (flags & URL_WRONLY) { access = O_CREAT | O_TRUNC | O_WRONLY; } else { access = O_RDONLY;