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
e00e13db
Commit
e00e13db
authored
Jul 05, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L2: error handling
confere posix_memalign documentation
parent
a02d4d68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
modules/access/v4l2/v4l2.c
modules/access/v4l2/v4l2.c
+4
-11
No files found.
modules/access/v4l2/v4l2.c
View file @
e00e13db
...
...
@@ -1761,32 +1761,25 @@ static int InitUserP( demux_t *p_demux, int i_fd, unsigned int i_buffer_size )
if
(
ioctl
(
i_fd
,
VIDIOC_REQBUFS
,
&
req
)
<
0
)
{
msg_Err
(
p_demux
,
"device does not support user pointer i/o"
);
goto
open_failed
;
return
VLC_EGENERIC
;
}
p_sys
->
p_buffers
=
calloc
(
4
,
sizeof
(
*
p_sys
->
p_buffers
)
);
if
(
!
p_sys
->
p_buffers
)
{
msg_Err
(
p_demux
,
"Out of memory"
);
goto
open_failed
;
}
for
(
p_sys
->
i_nbuffers
=
0
;
p_sys
->
i_nbuffers
<
4
;
++
p_sys
->
i_nbuffers
)
{
p_sys
->
p_buffers
[
p_sys
->
i_nbuffers
].
length
=
i_buffer_size
;
posix_memalign
(
&
p_sys
->
p_buffers
[
p_sys
->
i_nbuffers
].
start
,
/* boundary */
i_page_size
,
i_buffer_size
);
if
(
!
p_sys
->
p_buffers
[
p_sys
->
i_nbuffers
].
start
)
{
msg_Err
(
p_demux
,
"out of memory"
);
if
(
posix_memalign
(
&
p_sys
->
p_buffers
[
p_sys
->
i_nbuffers
].
start
,
/* boundary */
i_page_size
,
i_buffer_size
)
)
goto
open_failed
;
}
}
return
VLC_SUCCESS
;
open_failed:
free
(
p_sys
->
p_buffers
);
return
VLC_EGENERIC
;
}
...
...
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