summaryrefslogtreecommitdiff
path: root/libavcodec/v4l2_context.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2019-08-27 17:21:36 -0700
committerAman Gupta <aman@tmm1.net>2019-09-10 18:52:37 -0700
commit7bb6898b16f3c5b1cd5c4c15ca96278df569ccd2 (patch)
treead14565005692c9de754e0318187102a50ff1750 /libavcodec/v4l2_context.c
parentac52e06e56fd0232f13c0da74177181e04172e00 (diff)
avcodec/v4l2_m2m: fix av_pix_fmt changing when multiple /dev/video* devices are probed
On the RPI, three different /dev/video devices exist (decoder, scaler, encoder). When probing the devices in order, the originally requested pix fmt would be mutated causing the wrong one to be chosen when a matching device was finally found. Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/v4l2_context.c')
-rw-r--r--libavcodec/v4l2_context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
index 6924760840..3f8a510331 100644
--- a/libavcodec/v4l2_context.c
+++ b/libavcodec/v4l2_context.c
@@ -621,7 +621,7 @@ int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt)
return ff_v4l2_buffer_buf_to_avpkt(pkt, avbuf);
}
-int ff_v4l2_context_get_format(V4L2Context* ctx)
+int ff_v4l2_context_get_format(V4L2Context* ctx, int probe)
{
struct v4l2_format_update fmt = { 0 };
int ret;
@@ -631,7 +631,7 @@ int ff_v4l2_context_get_format(V4L2Context* ctx)
if (ret)
return ret;
- fmt.update_avfmt = 1;
+ fmt.update_avfmt = !probe;
v4l2_save_to_context(ctx, &fmt);
/* format has been tried already */