Commit ea115d54 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (6087): ivtv: prevent changing VBI format while capture is in progress

Changing the VBI format requires a CX2341X_ENC_INITIALIZE_INPUT firmware
call. This can only be done if no capture is in progress. So return
-EBUSY if the encoder is busy.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent ad8ff0f1
...@@ -584,9 +584,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype, ...@@ -584,9 +584,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype,
/* set raw VBI format */ /* set raw VBI format */
if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) { if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
if (set_fmt && streamtype == IVTV_ENC_STREAM_TYPE_VBI && if (set_fmt && atomic_read(&itv->capturing) > 0) {
itv->vbi.sliced_in->service_set &&
atomic_read(&itv->capturing) > 0) {
return -EBUSY; return -EBUSY;
} }
if (set_fmt) { if (set_fmt) {
...@@ -624,7 +622,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype, ...@@ -624,7 +622,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype,
return 0; return 0;
if (set == 0) if (set == 0)
return -EINVAL; return -EINVAL;
if (atomic_read(&itv->capturing) > 0 && itv->vbi.sliced_in->service_set == 0) { if (atomic_read(&itv->capturing) > 0) {
return -EBUSY; return -EBUSY;
} }
itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); itv->video_dec_func(itv, VIDIOC_S_FMT, fmt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment