summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2016-12-26 15:52:30 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2016-12-26 15:52:30 +0100
commit3223b553cd5a6191c33509ca06aea07232724dbb (patch)
treec586d85b17819e94cfdac947290b14081c4cd9b8 /modules
parent29479d4f23617b6fb5b51e9b84c06948919d3162 (diff)
avformat: check prm and print correct time_base
Diffstat (limited to 'modules')
-rw-r--r--modules/avformat/avformat.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/avformat/avformat.c b/modules/avformat/avformat.c
index f37c391..b537868 100644
--- a/modules/avformat/avformat.c
+++ b/modules/avformat/avformat.c
@@ -218,7 +218,7 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
(void)mctx;
(void)errorh;
- if (!stp || !size || !frameh)
+ if (!stp || !vs || !prm || !size || !frameh)
return EINVAL;
st = mem_zalloc(sizeof(*st), destructor);
@@ -229,13 +229,7 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
st->sz = *size;
st->frameh = frameh;
st->arg = arg;
-
- if (prm) {
- st->fps = prm->fps;
- }
- else {
- st->fps = 25;
- }
+ st->fps = prm->fps;
/*
* avformat_open_input() was added in lavf 53.2.0 according to
@@ -311,7 +305,7 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
debug("avformat: stream %u: %u x %u "
" time_base=%d/%d\n",
i, ctx->width, ctx->height,
- ctx->time_base.num, ctx->time_base.den);
+ strm->time_base.num, strm->time_base.den);
st->sz.w = ctx->width;
st->sz.h = ctx->height;