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
87dd62e1
Commit
87dd62e1
authored
Apr 12, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/testsrc: make use of AV_OPT_TYPE_DURATION
Simplify.
parent
dcea5850
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
vsrc_testsrc.c
libavfilter/vsrc_testsrc.c
+2
-10
No files found.
libavfilter/vsrc_testsrc.c
View file @
87dd62e1
...
@@ -53,7 +53,6 @@ typedef struct {
...
@@ -53,7 +53,6 @@ typedef struct {
unsigned
int
nb_frame
;
unsigned
int
nb_frame
;
AVRational
time_base
,
frame_rate
;
AVRational
time_base
,
frame_rate
;
int64_t
pts
;
int64_t
pts
;
char
*
duration_str
;
///< total duration of the generated video
int64_t
duration
;
///< duration expressed in microseconds
int64_t
duration
;
///< duration expressed in microseconds
AVRational
sar
;
///< sample aspect ratio
AVRational
sar
;
///< sample aspect ratio
int
nb_decimals
;
int
nb_decimals
;
...
@@ -80,8 +79,8 @@ typedef struct {
...
@@ -80,8 +79,8 @@ typedef struct {
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },\
{ "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 },\
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },\
{ "duration", "set video duration", OFFSET(duration
_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0
, FLAGS },\
{ "duration", "set video duration", OFFSET(duration
), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX
, FLAGS },\
{ "d", "set video duration", OFFSET(duration
_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0
, FLAGS },\
{ "d", "set video duration", OFFSET(duration
), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX
, FLAGS },\
{ "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX, FLAGS },
{ "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX, FLAGS },
...
@@ -108,13 +107,6 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -108,13 +107,6 @@ static av_cold int init(AVFilterContext *ctx)
TestSourceContext
*
test
=
ctx
->
priv
;
TestSourceContext
*
test
=
ctx
->
priv
;
int
ret
=
0
;
int
ret
=
0
;
test
->
duration
=
-
1
;
if
(
test
->
duration_str
&&
(
ret
=
av_parse_time
(
&
test
->
duration
,
test
->
duration_str
,
1
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid duration: '%s'
\n
"
,
test
->
duration_str
);
return
ret
;
}
if
(
test
->
nb_decimals
&&
strcmp
(
ctx
->
filter
->
name
,
"testsrc"
))
{
if
(
test
->
nb_decimals
&&
strcmp
(
ctx
->
filter
->
name
,
"testsrc"
))
{
av_log
(
ctx
,
AV_LOG_WARNING
,
av_log
(
ctx
,
AV_LOG_WARNING
,
"Option 'decimals' is ignored with source '%s'
\n
"
,
"Option 'decimals' is ignored with source '%s'
\n
"
,
...
...
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