summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-01-07 18:54:50 +0100
committerAnton Khirnov <anton@khirnov.net>2013-01-13 16:31:09 +0100
commit838b849e70f11dc242399da8d19c5795fe90913b (patch)
tree9945abf974f822025eb905ac540c5c7856b833fc
parent246da0b13551b1f80f067e4f258e5bd691f5ab33 (diff)
downloadffmpeg-838b849e70f11dc242399da8d19c5795fe90913b.tar.gz
v4l2: set the average framerate instead of codec timebase.
Codec timebase is supposed to be set by decoders only.
-rw-r--r--libavdevice/v4l2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index fd2ab385c0..eb5de151f3 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -634,11 +634,11 @@ static int v4l2_set_parameters(AVFormatContext *s1)
return AVERROR(errno);
}
}
- s1->streams[0]->codec->time_base.den = tpf->denominator;
- s1->streams[0]->codec->time_base.num = tpf->numerator;
+ s1->streams[0]->avg_frame_rate.num = tpf->denominator;
+ s1->streams[0]->avg_frame_rate.den = tpf->numerator;
s->timeout = 100 +
- av_rescale_q(1, s1->streams[0]->codec->time_base,
+ av_rescale_q(1, s1->streams[0]->avg_frame_rate,
(AVRational){1, 1000});
return 0;
@@ -779,7 +779,7 @@ static int v4l2_read_header(AVFormatContext *s1)
avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
st->codec->width = s->width;
st->codec->height = s->height;
- st->codec->bit_rate = s->frame_size * 1/av_q2d(st->codec->time_base) * 8;
+ st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8;
return 0;
}