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
3448404a
Commit
3448404a
authored
May 17, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavfilter: add ff_parse_time_base()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6579bc43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
formats.c
libavfilter/formats.c
+12
-0
internal.h
libavfilter/internal.h
+10
-0
No files found.
libavfilter/formats.c
View file @
3448404a
...
...
@@ -21,6 +21,7 @@
#include "libavutil/eval.h"
#include "libavutil/pixdesc.h"
#include "libavutil/parseutils.h"
#include "libavutil/audioconvert.h"
#include "avfilter.h"
#include "internal.h"
...
...
@@ -493,6 +494,17 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx)
return
0
;
}
int
ff_parse_time_base
(
AVRational
*
ret
,
const
char
*
arg
,
void
*
log_ctx
)
{
AVRational
r
;
if
(
av_parse_ratio
(
&
r
,
arg
,
INT_MAX
,
0
,
log_ctx
)
<
0
||
r
.
num
<=
0
||
r
.
den
<=
0
)
{
av_log
(
log_ctx
,
AV_LOG_ERROR
,
"Invalid time base '%s'
\n
"
,
arg
);
return
AVERROR
(
EINVAL
);
}
*
ret
=
r
;
return
0
;
}
int
ff_parse_sample_rate
(
int
*
ret
,
const
char
*
arg
,
void
*
log_ctx
)
{
char
*
tail
;
...
...
libavfilter/internal.h
View file @
3448404a
...
...
@@ -111,6 +111,16 @@ int ff_parse_pixel_format(enum PixelFormat *ret, const char *arg, void *log_ctx)
*/
int
ff_parse_sample_rate
(
int
*
ret
,
const
char
*
arg
,
void
*
log_ctx
);
/**
* Parse a time base.
*
* @param ret unsigned AVRational pointer to where the value should be written
* @param arg string to parse
* @param log_ctx log context
* @return 0 in case of success, a negative AVERROR code on error
*/
int
ff_parse_time_base
(
AVRational
*
ret
,
const
char
*
arg
,
void
*
log_ctx
);
/**
* Parse a sample format name or a corresponding integer representation.
*
...
...
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