Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8ead2f57
Commit
8ead2f57
authored
Dec 28, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to implement waitpipe with Winsock (should fix #1347)
parent
df796fbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
4 deletions
+53
-4
src/misc/objects.c
src/misc/objects.c
+53
-4
No files found.
src/misc/objects.c
View file @
8ead2f57
...
...
@@ -467,6 +467,59 @@ void __vlc_object_unlock( vlc_object_t *obj )
vlc_mutex_unlock
(
&
obj
->
object_lock
);
}
#ifdef WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
/**
* select()-able pipes emulated using Winsock
*/
static
int
pipe
(
int
fd
[
2
])
{
SOCKADDR_IN
addr
;
int
addrlen
=
sizeof
(
addr
);
SOCKET
l
=
socket
(
PF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
),
a
,
c
=
socket
(
PF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
((
l
==
INVALID_SOCKET
)
||
(
c
==
INVALID_SOCKET
))
goto
error
;
memset
(
&
addr
,
0
,
sizeof
(
addr
));
addr
.
sin_family
=
AF_INET
;
addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
if
(
bind
(
l
,
(
PSOCKADDR
)
&
addr
,
sizeof
(
addr
))
||
getsockname
(
l
,
(
PSOCKADDR
)
&
addr
,
&
addrlen
)
||
listen
(
l
,
1
)
||
connect
(
c
,
(
PSOCKADDR
)
&
addr
,
addrlen
))
goto
error
;
a
=
accept
(
l
,
NULL
,
NULL
);
if
(
a
==
INVALID_SOCKET
)
goto
error
;
closesocket
(
l
);
shutdown
(
a
,
0
);
shutdown
(
c
,
1
);
fd
[
0
]
=
c
;
fd
[
1
]
=
a
;
return
0
;
error:
if
(
l
!=
INVALID_SOCKET
)
closesocket
(
l
);
if
(
c
!=
INVALID_SOCKET
)
closesocket
(
c
);
return
-
1
;
}
#undef read
#define read( a, b, c ) recv (a, b, c, 0)
#undef write
#define write( a, b, c ) send (a, b, c, 0)
#undef close
#define close( a ) closesocket (a)
#endif
/* WIN32 */
/**
* Returns the readable end of a pipe that becomes readable whenever
* an object is signaled. This can be used to wait for VLC object events
...
...
@@ -492,11 +545,7 @@ int __vlc_object_waitpipe( vlc_object_t *obj )
/* This can only ever happen if someone killed us without locking */
assert
(
pipes
[
0
]
==
-
1
);
#ifndef WIN32
if
(
pipe
(
pipes
)
)
#else
errno
=
ENOSYS
;
#endif
return
-
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment