diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-29 10:51:55 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-29 10:51:55 -0400 |
commit | f40d5d893f0c1750753a11b5e1c86af4f6a4cc9a (patch) | |
tree | 0d6515eefeb52c78c75e1a856fb04fd7f5c7b699 | |
parent | f4b5a4d12e2f2f16c88fa7f91abf48ceeb457e4d (diff) |
wcap-decode: Fix setting framerate
Default to 30fps instead of crashing if we don't get a framerate on the
command line.
-rw-r--r-- | wcap/vpxenc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/wcap/vpxenc.c b/wcap/vpxenc.c index 1de4f92..793b73f 100644 --- a/wcap/vpxenc.c +++ b/wcap/vpxenc.c @@ -315,6 +315,7 @@ struct input_state int use_i420; struct wcap_decoder *wcap; uint32_t output_msecs; + struct vpx_rational output_framerate; }; static inline int rgb_to_yuv(uint32_t format, uint32_t p, int *u, int *v) @@ -1811,8 +1812,14 @@ void open_input_file(struct input_state *input, struct global_config *global) input->file_type = FILE_TYPE_WCAP; input->w = input->wcap->width; input->h = input->wcap->height; - input->framerate = global->framerate; input->use_i420 = 0; + if (global->have_framerate) { + input->framerate = global->framerate; + } + else { + input->framerate.num = 30; + input->framerate.den = 1; + } } else { |