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
db84088e
Commit
db84088e
authored
Apr 17, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/mptestsrc: use AV_OPT_TYPE_DURATION
Simplify.
parent
bbf003e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
vsrc_mptestsrc.c
libavfilter/vsrc_mptestsrc.c
+7
-14
No files found.
libavfilter/vsrc_mptestsrc.c
View file @
db84088e
...
...
@@ -54,9 +54,9 @@ typedef struct MPTestContext {
const
AVClass
*
class
;
unsigned
int
frame_nb
;
AVRational
frame_rate
;
int64_t
pts
,
max_pts
;
int64_t
pts
,
max_pts
,
duration
;
int
hsub
,
vsub
;
char
*
size
,
*
duration
;
char
*
size
;
enum
test_type
test
;
}
MPTestContext
;
...
...
@@ -65,8 +65,8 @@ typedef struct MPTestContext {
static
const
AVOption
mptestsrc_options
[]
=
{
{
"rate"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"duration"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"d"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
z
{
"duration"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
DURATION
,
{.
i64
=
-
1
},
-
1
,
INT64_MAX
,
FLAGS
},
{
"d"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
DURATION
,
{.
i64
=
-
1
},
-
1
,
INT64_MAX
,
FLAGS
},
{
"test"
,
"set test to perform"
,
OFFSET
(
test
),
AV_OPT_TYPE_INT
,
{.
i64
=
TEST_ALL
},
0
,
INT_MAX
,
FLAGS
,
"test"
},
{
"t"
,
"set test to perform"
,
OFFSET
(
test
),
AV_OPT_TYPE_INT
,
{.
i64
=
TEST_ALL
},
0
,
INT_MAX
,
FLAGS
,
"test"
},
...
...
@@ -258,22 +258,15 @@ static void ring2_test(uint8_t *dst, int dst_linesize, int off)
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
MPTestContext
*
test
=
ctx
->
priv
;
int64_t
duration
=
-
1
;
int
ret
;
if
((
test
->
duration
)
&&
(
ret
=
av_parse_time
(
&
duration
,
test
->
duration
,
1
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid duration: '%s'
\n
"
,
test
->
duration
);
return
ret
;
}
test
->
max_pts
=
duration
>=
0
?
av_rescale_q
(
duration
,
AV_TIME_BASE_Q
,
av_inv_q
(
test
->
frame_rate
))
:
-
1
;
test
->
max_pts
=
test
->
duration
>=
0
?
av_rescale_q
(
test
->
duration
,
AV_TIME_BASE_Q
,
av_inv_q
(
test
->
frame_rate
))
:
-
1
;
test
->
frame_nb
=
0
;
test
->
pts
=
0
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"rate:%d/%d duration:%f
\n
"
,
test
->
frame_rate
.
num
,
test
->
frame_rate
.
den
,
duration
<
0
?
-
1
:
test
->
max_pts
*
av_q2d
(
av_inv_q
(
test
->
frame_rate
)));
test
->
duration
<
0
?
-
1
:
test
->
max_pts
*
av_q2d
(
av_inv_q
(
test
->
frame_rate
)));
init_idct
();
return
0
;
...
...
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