You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
libavfilter: add ff_parse_time_base()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user