summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineering.com>2019-12-09 00:36:54 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2019-12-09 00:46:40 -0600
commit3de2fd9b5378a9c472433baa7556c8fef61a482e (patch)
treed2db15338717496c19a2a46ee818f341529bedb2
parentedefa0cdd8d0a83aeb6b545b1914a7a2a0bcbd30 (diff)
downloadffmpeg-streaming-3de2fd9b5378a9c472433baa7556c8fef61a482e.zip
ffmpeg-streaming-3de2fd9b5378a9c472433baa7556c8fef61a482e.tar.gz
Re-read actual capture timebase from V4L2 after framerate request
Sometimes V4L2 drivers can change the actual capture timebase after a framerate request is made. Ensure the actual capture timebase is read / reported instead of what ffmpeg tried to use.
-rw-r--r--libavdevice/v4l2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 365bacd..15e1258 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -740,6 +740,13 @@ static int v4l2_set_parameters(AVFormatContext *ctx)
return ret;
}
+ if (v4l2_ioctl(s->fd, VIDIOC_G_PARM, &streamparm) < 0) {
+ ret = AVERROR(errno);
+ av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_G_PARM): %s\n",
+ av_err2str(ret));
+ return ret;
+ }
+
if (framerate_q.num != tpf->denominator ||
framerate_q.den != tpf->numerator) {
av_log(ctx, AV_LOG_INFO,
OpenPOWER on IntegriCloud