[FFmpeg-devel] [PATCH]lavd/v4l2: Do not set frame_set to a negative value
Carl Eugen Hoyos
cehoyos at ag.or.at
Sat Dec 10 17:49:08 EET 2016
Hi!
Attached patch fixes a minor bug, displaying a negative bitrate.
Please comment, Carl Eugen
-------------- next part --------------
From e2e4999c9e91fb2f6bcc782fdfe7a2f5d73d7600 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
Date: Sat, 10 Dec 2016 16:43:00 +0100
Subject: [PATCH] lavd/v4l2: Avoid setting frame_size to a negative value.
---
libavdevice/v4l2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index ae51d83..b57909bd 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -936,6 +936,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
goto fail;
st->codecpar->format = ff_fmt_v4l2ff(desired_format, codec_id);
+ if (st->codecpar->format != AV_PIX_FMT_NONE)
s->frame_size = av_image_get_buffer_size(st->codecpar->format,
s->width, s->height, 1);
--
1.7.10.4
More information about the ffmpeg-devel
mailing list