summaryrefslogtreecommitdiff
path: root/sys/mfc
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2013-01-02 14:27:53 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-01-02 14:27:53 +0100
commit644ef86728aa742d2b51161c6882f0a711c8a8d6 (patch)
tree75f16874ce543496d99be333cfc8110bf0160845 /sys/mfc
parent954ad793201dc25e70ba8ff667fd884949c98c19 (diff)
downloadgstreamer-plugins-bad-644ef86728aa742d2b51161c6882f0a711c8a8d6.tar.gz
mfc: Don't STREAMOFF if no STREAMON happened yet
Diffstat (limited to 'sys/mfc')
-rw-r--r--sys/mfc/mfc_decoder/mfc_decoder.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/mfc/mfc_decoder/mfc_decoder.c b/sys/mfc/mfc_decoder/mfc_decoder.c
index 9070920d9..80ddf316d 100644
--- a/sys/mfc/mfc_decoder/mfc_decoder.c
+++ b/sys/mfc/mfc_decoder/mfc_decoder.c
@@ -75,6 +75,9 @@ struct mfc_dec_context {
int num_output_buffers;
struct mfc_buffer *input_buffer;
struct mfc_buffer *output_buffer;
+
+ int input_streamon, output_streamon;
+
/*
* Number of decoded frames the MFC needs to have access to to
* decode correctly.
@@ -382,6 +385,7 @@ static int start_input_stream(struct mfc_dec_context *ctx)
GST_ERROR ("Unable to start input stream");
return -1;
}
+ ctx->input_streamon = 1;
return 0;
}
@@ -392,6 +396,7 @@ static int start_output_stream(struct mfc_dec_context *ctx)
GST_ERROR ("Unable to start output stream");
return -1;
}
+ ctx->output_streamon = 1;
return 0;
}
@@ -439,12 +444,17 @@ void mfc_dec_destroy(struct mfc_dec_context *ctx)
{
int i;
int type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- if (ioctl(ctx->fd, VIDIOC_STREAMOFF, &type) < 0)
- GST_ERROR ("Streamoff failed on output");
+
+ if (ctx->output_streamon)
+ if (ioctl(ctx->fd, VIDIOC_STREAMOFF, &type) < 0)
+ GST_ERROR ("Streamoff failed on output");
+ ctx->output_streamon = 0;
type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- if (ioctl(ctx->fd, VIDIOC_STREAMOFF, &type) < 0)
- GST_ERROR ("Streamoff failed on input");
+ if (ctx->input_streamon)
+ if (ioctl(ctx->fd, VIDIOC_STREAMOFF, &type) < 0)
+ GST_ERROR ("Streamoff failed on input");
+ ctx->input_streamon = 0;
for (i = 0; i < ctx->num_input_buffers; i++) {
if (ctx->input_buffer[i].plane[0].data)