Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
35774162
Commit
35774162
authored
May 26, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bktr: factorize returning error codes.
This will be useful in the following commit.
parent
86f86877
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
bktr.c
libavdevice/bktr.c
+15
-7
No files found.
libavdevice/bktr.c
View file @
35774162
...
...
@@ -249,9 +249,12 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
int
width
,
height
;
int
frame_rate
;
int
frame_rate_base
;
int
ret
=
0
;
if
(
ap
->
width
<=
0
||
ap
->
height
<=
0
||
ap
->
time_base
.
den
<=
0
)
return
-
1
;
if
(
ap
->
width
<=
0
||
ap
->
height
<=
0
||
ap
->
time_base
.
den
<=
0
)
{
ret
=
AVERROR
(
EINVAL
);
goto
out
;
}
width
=
ap
->
width
;
height
=
ap
->
height
;
...
...
@@ -259,8 +262,10 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
frame_rate_base
=
ap
->
time_base
.
num
;
st
=
av_new_stream
(
s1
,
0
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
if
(
!
st
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
out
;
}
av_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in use */
s
->
width
=
width
;
...
...
@@ -289,13 +294,16 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
#endif
if
(
bktr_init
(
s1
->
filename
,
width
,
height
,
s
->
standard
,
&
(
s
->
video_fd
),
&
(
s
->
tuner_fd
),
-
1
,
0
.
0
)
<
0
)
return
AVERROR
(
EIO
);
&
(
s
->
video_fd
),
&
(
s
->
tuner_fd
),
-
1
,
0
.
0
)
<
0
)
{
ret
=
AVERROR
(
EIO
);
goto
out
;
}
nsignals
=
0
;
last_frame_time
=
0
;
return
0
;
out:
return
ret
;
}
static
int
grab_read_close
(
AVFormatContext
*
s1
)
...
...
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