2
2
* Buffered file io for ffmpeg system
3
3
* Copyright (c) 2001 Fabrice Bellard
5
* This library is free software; you can redistribute it and/or
5
* This file is part of FFmpeg.
7
* FFmpeg is free software; you can redistribute it and/or
6
8
* modify it under the terms of the GNU Lesser General Public
7
9
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
12
* FFmpeg is distributed in the hope that it will be useful,
11
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
15
* Lesser General Public License for more details.
15
17
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
18
* License along with FFmpeg; if not, write to the Free Software
17
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
21
#include "avformat.h"
22
24
#include <unistd.h>
23
25
#include <sys/ioctl.h>
24
26
#include <sys/time.h>
27
29
#define open(fname,oflag,pmode) _open(fname,oflag,pmode)
28
#endif /* CONFIG_WIN32 */
30
#endif /* __MINGW32__ */
31
33
/* standard file protocol */
70
72
static offset_t file_seek(URLContext *h, offset_t pos, int whence)
72
74
int fd = (size_t)h->priv_data;
73
#if defined(CONFIG_WIN32) && !defined(__CYGWIN__)
75
#if defined(__MINGW32__)
74
76
return _lseeki64(fd, pos, whence);
76
78
return lseek(fd, pos, whence);