diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-12-21 23:02:30 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2018-01-11 11:27:38 -0500 |
commit | b3afa0dc1da53df65361e05a589a0e844d7947b3 (patch) | |
tree | 92611ff6ead712c22796c183ae3200ab2a5b5f90 /sys/v4l2/gstv4l2videoenc.c | |
parent | 34abfbff18a0864c9b244ccb274183aa03cabcde (diff) |
v4l2videoenc: Also re-enabled paused task
When we only run _finish(), the task is never stopped externally,
instead it's only paused from the inside. We still want to restart
it in this case.
Diffstat (limited to 'sys/v4l2/gstv4l2videoenc.c')
-rw-r--r-- | sys/v4l2/gstv4l2videoenc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c index c9a8040f4..4a1a8afb1 100644 --- a/sys/v4l2/gstv4l2videoenc.c +++ b/sys/v4l2/gstv4l2videoenc.c @@ -711,14 +711,15 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder, { GstV4l2VideoEnc *self = GST_V4L2_VIDEO_ENC (encoder); GstFlowReturn ret = GST_FLOW_OK; + GstTaskState task_state; GST_DEBUG_OBJECT (self, "Handling frame %d", frame->system_frame_number); if (G_UNLIKELY (!g_atomic_int_get (&self->active))) goto flushing; - if (gst_pad_get_task_state (GST_VIDEO_DECODER_SRC_PAD (self)) == - GST_TASK_STOPPED) { + task_state = gst_pad_get_task_state (GST_VIDEO_DECODER_SRC_PAD (self)); + if (task_state == GST_TASK_STOPPED || task_state == GST_TASK_PAUSED) { GstBufferPool *pool = GST_BUFFER_POOL (self->v4l2output->pool); /* It possible that the processing thread stopped due to an error */ |