mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-30 00:17:44 +00:00
move resolve_host from tcp.c to os_support.c as it is used widely
Originally committed as revision 8834 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a33cc9511b
commit
383eda2348
2 changed files with 20 additions and 17 deletions
|
@ -28,20 +28,6 @@ typedef struct TCPContext {
|
|||
int fd;
|
||||
} TCPContext;
|
||||
|
||||
/* resolve host with also IP address parsing */
|
||||
int resolve_host(struct in_addr *sin_addr, const char *hostname)
|
||||
{
|
||||
struct hostent *hp;
|
||||
|
||||
if (!inet_aton(hostname, sin_addr)) {
|
||||
hp = gethostbyname(hostname);
|
||||
if (!hp)
|
||||
return -1;
|
||||
memcpy(sin_addr, hp->h_addr, sizeof(struct in_addr));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* return non zero if error */
|
||||
static int tcp_open(URLContext *h, const char *uri, int flags)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue