[SCM] libav/experimental: avio patch by (Gildas Bazin <gbazin at altern dot org>)

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:39:14 UTC 2013


The following commit has been merged in the experimental branch:
commit ac9fe33d0ee55372b75fbae93d2954cff9974bf0
Author: Gildas Bazin <gbazi at altern.org>
Date:   Sat Feb 14 16:25:32 2004 +0000

    avio patch by (Gildas Bazin <gbazin at altern dot org>)
    
    Originally committed as revision 2783 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 12760a8..de14096 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -429,7 +429,7 @@ int url_fdopen(ByteIOContext *s, URLContext *h)
         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_fget_max_packet_size(ByteIOContext *s)
 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 --git a/libavformat/file.c b/libavformat/file.c
index ee1f72a..b1d61ca 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -37,7 +37,9 @@ static int file_open(URLContext *h, const char *filename, int flags)
 
     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;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list