From: Michal Sojka Date: Sun, 29 Nov 2009 13:20:34 +0000 (+0100) Subject: Revert "Attempt to open files with O_DIRECT" X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/6eff4327955747dd3633b6b82ce39cfab817ce5a Revert "Attempt to open files with O_DIRECT" 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. --- diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 690ac9aac..f270139a9 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -24,8 +24,6 @@ #include "avformat.h" #include "avio.h" #include -#include -#include #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); diff --git a/libavformat/file.c b/libavformat/file.c index 402a58e79..da0ce1509 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -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 @@ -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; }