Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-05-20 15:53:50 +0400
committerNicolas George <nicolas.george@normalesup.org>2012-05-20 20:24:20 +0400
commit16a44b41ab2a13e342f5daea9579aefdc823c3d4 (patch)
tree3e2e19b7edb24bb9772663b27a370369017b8145 /libavfilter
parent2ec3e5767e7bb7f089c22f7fba7becc32eef8394 (diff)
vsrc_testsrc: use AV_OPT_TYPE_IMAGE_SIZE.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vsrc_testsrc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 4ba0b52525..7cf29eeefc 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -39,11 +39,10 @@
typedef struct {
const AVClass *class;
- int h, w;
+ int w, h;
unsigned int nb_frame;
AVRational time_base;
int64_t pts, max_pts;
- char *size; ///< video frame size
char *rate; ///< video frame rate
char *duration; ///< total duration of the generated video
AVRational sar; ///< sample aspect ratio
@@ -58,8 +57,8 @@ typedef struct {
#define OFFSET(x) offsetof(TestSourceContext, x)
static const AVOption testsrc_options[]= {
- { "size", "set video size", OFFSET(size), AV_OPT_TYPE_STRING, {.str = "320x240"}, 0, 0 },
- { "s", "set video size", OFFSET(size), AV_OPT_TYPE_STRING, {.str = "320x240"}, 0, 0 },
+ { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
+ { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
{ "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
{ "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
{ "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
@@ -84,12 +83,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
return ret;
}
- if ((ret = av_parse_video_size(&test->w, &test->h, test->size)) < 0) {
- av_log(ctx, AV_LOG_ERROR, "Invalid frame size: '%s'\n", test->size);
- return ret;
- }
- av_freep(&test->size);
-
if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0 ||
frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", test->rate);