summaryrefslogtreecommitdiff
path: root/libavformat/os_support.c
Commit message (Collapse)AuthorAge
* os_support: Don't try to return the service name as a string in getnameinfoMartin Storsjö2015-10-30
| | | | | | | | | | | | | Some systems may be lacking getservbyport; the previous ifdef wasn't quite enough since it still assumed that struct servent was defined, as pointed out by Clément Gregoire. Simply remove the possibility to return non-numeric services in getnameinfo; no caller of getnameinfo within libavformat currently try to use getnameinfo for retrieving the port number without NI_NUMERICSERV, and falling back on getservbyport may be non-threadsafe. Signed-off-by: Martin Storsjö <martin@martin.st>
* os_support: Add #endif comments for better readabilityDiego Biurrun2013-11-02
|
* file: Move win32 utf8->wchar open wrapper to libavutilMartin Storsjö2013-08-08
| | | | | | | | | | | | | When libavformat was changed to use the new avpriv_open function in 51eb213d001, this silently bypassed the existing wrapper for win32. Move the win32 wrapper into libavutil/file.c to make sure it gets called everywhere (not just in the libavformat case). This makes sure that non-ascii file names gets opened properly (where file names internally are stored as utf8, but they get converted to wchar_t and opened with _wsopen). Signed-off-by: Martin Storsjö <martin@martin.st>
* win32: Use 64-bit fstat/lseek variants for MSVC as wellHendrik Leppkes2013-03-27
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* win32: Make ff_win32_open more robustReimar Döffinger2013-03-27
| | | | | | | | | | | - Make MultiByteToWideChar fail when it encounters invalid encoding. Without this, invalid characters might just be skipped - When MultiByteToWideChar fails, assume the file name is in CP_ACP and open it via normal open function, even when the file will be written - When malloc fails return error instead of crashing Signed-off-by: Martin Storsjö <martin@martin.st>
* win32: Allow other programs to open the same filesReimar Döffinger2013-03-27
| | | | | | | In order to match Linux behaviour better our Windows-specific open() replacement should disable Windows default file locking. Signed-off-by: Martin Storsjö <martin@martin.st>
* network: use getservbyport() only if availableMans Rullgard2012-10-23
| | | | | | | The absence of this function will only give a less informative string back from our fallback implementation of getnameinfo(). Signed-off-by: Mans Rullgard <mans@mansr.com>
* os_support: K&R formatting cosmeticsDiego Biurrun2012-07-17
|
* network: Always use our version of gai_strerror on windowsMartin Storsjö2012-07-15
| | | | | | | | Even if linking directly to getaddrinfo, use our version of gai_strerror instead of the system's version. Microsoft explicitly documents that their version of gai_strerror is thread-unsafe. Signed-off-by: Martin Storsjö <martin@martin.st>
* network: Extend the fallback gai_strerror implementation to handle more ↵Martin Storsjö2012-07-15
| | | | | | | | | error codes This is useful if a proper getaddrinfo is loaded dynamically on windows, while using the fallback implementation of gai_strerror. Signed-off-by: Martin Storsjö <martin@martin.st>
* os_support: Rename the poll fallback function to ff_pollMartin Storsjö2012-06-30
| | | | | | | | | | | | The fallback function is a non-static function, we shouldn't be defining non-static functions outside of the proper ff/av prefix namespaces. This is especially important for a function like poll, which other parties (other libraries, or executables linking these libraries) also might provide similar but incompatible fallbacks for. Signed-off-by: Martin Storsjö <martin@martin.st>
* os_support: Don't compare a negative number against socket descriptorsMartin Storsjö2012-06-30
| | | | | | | | The fds are unsigned integers in the windows definition of struct sockfds. Due to this, the comparison if (fds[i].fd > n) was always false. Signed-off-by: Martin Storsjö <martin@martin.st>
* os_support: Include all the necessary headers for the win32 open functionRonald S. Bultje2012-06-30
| | | | | | | | | | | | | io.h is required for open and _wopen, and fcntl.h is required for the O_CREAT flag. On mingw, fcntl.h is included by os_support.h (and the mingw fcntl.h includes io.h), but include it explicitly here since this implementation requires it. Also move the #undef open up. open must not be defined to ff_win32_open while including the headers that declare the open function. On mingw, this happened in os_support.h before open was redirected. Signed-off-by: Martin Storsjö <martin@martin.st>
* configure: Check for sys/time.hRonald S. Bultje2012-06-26
| | | | | | | | Apparently this include is needed on some systems for building the poll fallback (for the timeval struct for select?), but it isn't available on all systems. Thus only include it if it exists. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: remove unnecessary inclusions of unistd.hMans Rullgard2012-06-20
| | | | | | These files do not use anything provided by unistd.h. Signed-off-by: Mans Rullgard <mans@mansr.com>
* network: Pass pointers of the right type to get/setsockopt/ioctlsocket on ↵Martin Storsjö2012-06-19
| | | | | | | | windows This avoids warnings. Signed-off-by: Martin Storsjö <martin@martin.st>
* Remove leftover includes of strings.hMartin Storsjö2011-11-06
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Remove some stray unnecessary ffmpeg references.Diego Biurrun2011-11-02
|
* configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.Diego Biurrun2011-05-12
| | | | | | | | | | | | | | | | Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems since it causes certain system functions to be hidden on some (BSD) systems. The solution is to only add the flag on systems that really require it, i.e. glibc-based ones. This change makes BSD systems compile out-of-the-box without the need for adding specific flags manually. It also allows dropping a number of flags set manually on a file-per-file basis, but were only present to work around breakage introduced by the presence of _POSIX_C_SOURCE. Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems. We use XSI extensions in several places already, so it is preferable to define it globally instead of littering source files with individual #defines only needed for glibc.
* Handle unicode file names on windowsKirill Gavrilov2011-04-24
| | | | | | | | | | | | | All file names should be in UTF-8 within libavformat. This is handled by mapping the open() function to an internal one in os_support.h for windows. fopen() could be overridden in the same way, but if that would be used from ffmpeg.c, it would add a dependency on an ff prefixed internal lavf function. Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* os_support: fix poll() implementationMax Shakhmetov2011-02-15
| | | | | | | Our poll implementation does not iterate over the pollfd array properly while setting the revents. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* os_support: make poll() fallbacks conditional on CONFIG_NETWORKMans Rullgard2011-01-28
| | | | | | | | | | | poll() is only used by networking code, so the fallback should only be built if networking is enabled. Also remove CONFIG_FFSERVER condition from the declarations. This should fix building on systems without poll(), broken by a8475bbdb64e638bd8161df9647876fd23f8a29a. Signed-off-by: Mans Rullgard <mans@mansr.com>
* os: replace select with pollLuca Barbato2011-01-28
| | | | | Select has limitations on the fd values it could accept and silently breaks when it is reached.
* os_support: include some headers only when neededMåns Rullgård2010-07-06
| | | | Originally committed as revision 24072 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move resolve_host() to ffserver.cMåns Rullgård2010-03-08
| | | | | | | | | | This deprecated function is only used by ffserver, yet does not have a prototype visible there. In the long term, ffserver should be made IPv6-aware. In the meantime, this change removes cruft from lavf and fixes some warnings in ffserver. Originally committed as revision 22329 to svn://svn.ffmpeg.org/ffmpeg/trunk
* inet_aton needs _DARWIN_C_SOURCE on OS XDavid Conrad2010-03-07
| | | | Originally committed as revision 22285 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.cDavid Conrad2010-03-07
| | | | Originally committed as revision 22284 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make our getaddrinfo implementation initialize "struct addrinfo" returnReimar Döffinger2010-02-28
| | | | | | value to NULL on errors. Originally committed as revision 22122 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Implement gai_strerror() for systems lacking such functionality. PatchRonald S. Bultje2010-02-08
| | | | | | by KO Myung-Hun <komh challion net>. Originally committed as revision 21692 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Load the proper getaddrinfo functions from ws2_32.dll, if they're present.Martin Storsjö2010-01-25
| | | | | | Patch by Martin Storsjö <martin at martin dot st>. Originally committed as revision 21443 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Provide a fallback for getnameinfo() also. Patch by Martin StorsjöMartin Storsjö2010-01-11
| | | | | | <$firstname()$firstname,st>. Originally committed as revision 21150 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Provide fallback implementations of getaddrinfo() and freeaddrinfo().Martin Storsjö2010-01-11
| | | | | | Patch by Martin Storsjö <$firstname()$firstname,st>. Originally committed as revision 21145 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use getaddrinfo(), if available, in resolve_host(). Patch by MartinRonald S. Bultje2010-01-11
| | | | | | Storsjö <$firstname()$firstname,st>. Originally committed as revision 21143 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Currently, the replacement which is used if inet_aton isn't available,Martin Storsjö2010-01-08
| | | | | | | | | only works correctly on little-endian. The attached patch makes it endian independent. Patch by Martin Storsjö <$firstname()$firstname,st>. Originally committed as revision 21080 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change semantic of CONFIG_*, HAVE_* and ARCH_*.Aurelien Jacobs2009-01-13
| | | | | | They are now always defined to either 0 or 1. Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
* struct timeval requires #include <sys/time.h>Dave Yeo2008-08-16
| | | | | | patch by Dave Yeo daveryeo _at_ telus _dot_ net Originally committed as revision 14793 to svn://svn.ffmpeg.org/ffmpeg/trunk
* use h_addr_list[0] instead of h_addr as this is the posix hostent field nameAurelien Jacobs2008-08-14
| | | | Originally committed as revision 14768 to svn://svn.ffmpeg.org/ffmpeg/trunk
* ensure we get explicit definition of various _XOPEN_SOURCE functions we useAurelien Jacobs2008-08-14
| | | | Originally committed as revision 14766 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Include poll.h instead of sys/poll.hLuca Abeni2008-02-13
| | | | Originally committed as revision 11924 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Check for the presence of sys/select.h and conditionally #include it.Michael Kostylev2007-12-27
| | | | | | patch by Michael Kostylev, mik niipt ru Originally committed as revision 11324 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix compilation of os_support.c for MinGW with --disable-networkTom Harper2007-12-09
| | | | | | Patch by Tom Harper <d.thomas.harper <at> gmail.com> Originally committed as revision 11200 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Include os_support.h only when neededLuca Abeni2007-11-21
| | | | Originally committed as revision 11073 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Check for winsock2.h instead of __MINGW32__Ramiro Polla2007-08-08
| | | | Originally committed as revision 9988 to svn://svn.ffmpeg.org/ffmpeg/trunk
* use sscanf to parse addressBenoit Fouet2007-07-19
| | | | Originally committed as revision 9756 to svn://svn.ffmpeg.org/ffmpeg/trunk
* remove useless checkBenoit Fouet2007-07-18
| | | | Originally committed as revision 9733 to svn://svn.ffmpeg.org/ffmpeg/trunk
* fix emulated inet_aton so that it fails for invalid addressesJoakim Plate2007-07-18
| | | | | | | | | patch by elupus: \elupus ecce se/ original thread: [FFmpeg-devel] [PATCH] emulated inet_aton doesn't fail for invalidaddresses date: 07/15/2007 12:40 AM Originally committed as revision 9731 to svn://svn.ffmpeg.org/ffmpeg/trunk
* MinGW has those include files.Ramiro Polla2007-07-16
| | | | Originally committed as revision 9707 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move av_gettime() back to lavf/utils.cRamiro Polla2007-07-16
| | | | Originally committed as revision 9706 to svn://svn.ffmpeg.org/ffmpeg/trunk
* MinGW has gettimeofday() since mingw-runtime-3.10Ramiro Polla2007-07-16
| | | | Originally committed as revision 9705 to svn://svn.ffmpeg.org/ffmpeg/trunk