]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Revert "Attempt to open files with O_DIRECT"
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 29 Nov 2009 13:20:34 +0000 (14:20 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 29 Nov 2009 13:20:34 +0000 (14:20 +0100)
This reverts commit 964a75e3a09560140453aecd74247bde6d61dd9e.

Although we have aligned buffer start, write() fails. According to
open(2), size must also be aligned and I'm not able to achieve this in
ffmpeg.

libavformat/aviobuf.c
libavformat/file.c

index 690ac9aac8e3ebf345956e38c4a407fcc8de3778..f270139a9ba4bfcbd3cc9be36b908580e146b3ed 100644 (file)
@@ -24,8 +24,6 @@
 #include "avformat.h"
 #include "avio.h"
 #include <stdarg.h>
-#include <malloc.h>
-#include <unistd.h>
 
 #define IO_BUFFER_SIZE 32768
 
@@ -540,7 +538,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h)
     } else {
         buffer_size = IO_BUFFER_SIZE;
     }
-    buffer = memalign(sysconf(_SC_PAGESIZE), buffer_size);
+    buffer = av_malloc(buffer_size);
     if (!buffer)
         return AVERROR(ENOMEM);
 
index 402a58e79aaf485aa1a962f109e89aa36dcf754c..da0ce150947bfb9b1671b740fbb581b3613dfdb3 100644 (file)
@@ -18,7 +18,7 @@
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#define _GNU_SOURCE
+
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include <fcntl.h>
@@ -43,7 +43,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
     if (flags & URL_RDWR) {
         access = O_CREAT | O_TRUNC | O_RDWR;
     } else if (flags & URL_WRONLY) {
-        access = O_CREAT | O_TRUNC | O_WRONLY | O_DIRECT;
+        access = O_CREAT | O_TRUNC | O_WRONLY;
     } else {
         access = O_RDONLY;
     }