Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
392a5a40
Commit
392a5a40
authored
Apr 27, 2004
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/access/v4l/v4l.c:
+ Fixed possible deadlocks.
parent
5ba84a43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
13 deletions
+36
-13
modules/access/v4l/v4l.c
modules/access/v4l/v4l.c
+36
-13
No files found.
modules/access/v4l/v4l.c
View file @
392a5a40
...
@@ -1292,23 +1292,31 @@ static uint8_t *GrabCapture( input_thread_t *p_input )
...
@@ -1292,23 +1292,31 @@ static uint8_t *GrabCapture( input_thread_t *p_input )
int
i_captured_frame
=
p_sys
->
i_frame_pos
;
int
i_captured_frame
=
p_sys
->
i_frame_pos
;
p_sys
->
vid_mmap
.
frame
=
(
p_sys
->
i_frame_pos
+
1
)
%
p_sys
->
vid_mbuf
.
frames
;
p_sys
->
vid_mmap
.
frame
=
(
p_sys
->
i_frame_pos
+
1
)
%
p_sys
->
vid_mbuf
.
frames
;
for
(
;;
)
while
(
ioctl
(
p_sys
->
fd_video
,
VIDIOCMCAPTURE
,
&
p_sys
->
vid_mmap
)
<
0
)
{
{
if
(
ioctl
(
p_sys
->
fd_video
,
VIDIOCMCAPTURE
,
&
p_sys
->
vid_mmap
)
>=
0
)
if
(
errno
!=
EAGAIN
)
{
{
break
;
msg_Err
(
p_input
,
"failed capturing new frame"
);
return
NULL
;
}
}
if
(
errno
!=
EAGAIN
)
if
(
p_input
->
b_die
)
{
{
msg_Err
(
p_input
,
"failed while grabbing new frame"
);
return
NULL
;
return
(
NULL
);
}
}
msg_Dbg
(
p_input
,
"another try ?"
);
msg_Dbg
(
p_input
,
"grab failed, trying again"
);
}
}
while
(
ioctl
(
p_sys
->
fd_video
,
VIDIOCSYNC
,
&
p_sys
->
i_frame_pos
)
<
0
&&
while
(
ioctl
(
p_sys
->
fd_video
,
VIDIOCSYNC
,
&
p_sys
->
i_frame_pos
)
<
0
)
(
errno
==
EAGAIN
||
errno
==
EINTR
)
);
{
if
(
errno
!=
EAGAIN
&&
errno
!=
EINTR
)
{
msg_Err
(
p_input
,
"failed syncing new frame"
);
return
NULL
;
}
}
p_sys
->
i_frame_pos
=
p_sys
->
vid_mmap
.
frame
;
p_sys
->
i_frame_pos
=
p_sys
->
vid_mmap
.
frame
;
/* leave i_video_frame_size alone */
/* leave i_video_frame_size alone */
...
@@ -1326,12 +1334,27 @@ static uint8_t *GrabMJPEG( input_thread_t *p_input )
...
@@ -1326,12 +1334,27 @@ static uint8_t *GrabMJPEG( input_thread_t *p_input )
/* re-queue the last frame we sync'd */
/* re-queue the last frame we sync'd */
if
(
p_sys
->
i_frame_pos
!=
-
1
)
if
(
p_sys
->
i_frame_pos
!=
-
1
)
while
(
ioctl
(
p_sys
->
fd_video
,
MJPIOC_QBUF_CAPT
,
&
p_sys
->
i_frame_pos
)
<
0
&&
{
(
errno
==
EAGAIN
||
errno
==
EINTR
)
);
while
(
ioctl
(
p_sys
->
fd_video
,
MJPIOC_QBUF_CAPT
,
&
p_sys
->
i_frame_pos
)
<
0
)
{
if
(
errno
!=
EAGAIN
&&
errno
!=
EINTR
)
{
msg_Err
(
p_input
,
"failed capturing new frame"
);
return
NULL
;
}
}
}
/* sync on the next frame */
/* sync on the next frame */
while
(
ioctl
(
p_sys
->
fd_video
,
MJPIOC_SYNC
,
&
sync
)
<
0
&&
while
(
ioctl
(
p_sys
->
fd_video
,
MJPIOC_SYNC
,
&
sync
)
<
0
)
(
errno
==
EAGAIN
||
errno
==
EINTR
)
);
{
if
(
errno
!=
EAGAIN
&&
errno
!=
EINTR
)
{
msg_Err
(
p_input
,
"failed syncing new frame"
);
return
NULL
;
}
}
p_sys
->
i_frame_pos
=
sync
.
frame
;
p_sys
->
i_frame_pos
=
sync
.
frame
;
p_frame
=
p_sys
->
p_video_mmap
+
p_sys
->
mjpeg_buffers
.
size
*
sync
.
frame
;
p_frame
=
p_sys
->
p_video_mmap
+
p_sys
->
mjpeg_buffers
.
size
*
sync
.
frame
;
...
...
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