vidc: Correct start and stop sequence.

Video core stop should be called only if start is successful.

Change-Id: Ie2a8d970355387ee3fcdc34b62184972e89dd6cc
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
This commit is contained in:
Deva Ramasubramanian 2012-09-11 16:56:21 -07:00 committed by Iliyan Malchev
parent f0adb8bf52
commit eb9863d4c8

View file

@ -577,6 +577,7 @@ static int vid_enc_open_client(struct video_client_ctx **vid_clnt_ctx,
rc = vcd_open(vid_enc_device_p->device_handle, false,
vid_enc_vcd_cb, client_ctx, flags);
client_ctx->stop_msg = 0;
client_ctx->stop_called = 1;
if (!rc) {
wait_for_completion(&client_ctx->event);
@ -662,7 +663,6 @@ static int vid_enc_open_secure(struct inode *inode, struct file *file)
return rc;
close_client:
client_ctx->stop_called = 1;
vid_enc_close_client(client_ctx);
ERR("Secure session operation failure\n");
error:
@ -1018,7 +1018,8 @@ static long vid_enc_ioctl(struct file *file,
if (!result) {
ERR("setting VEN_IOCTL_CMD_START failed\n");
return -EIO;
}
} else
client_ctx->stop_called = 0;
break;
}
case VEN_IOCTL_CMD_STOP: