diff options
author | Seungha Yang <seungha.yang@navercorp.com> | 2019-03-25 22:24:17 +0900 |
---|---|---|
committer | Seungha Yang <seungha.yang@navercorp.com> | 2019-03-25 22:26:35 +0900 |
commit | 60983fcea98b8e3ece1cadf4dd4783c9517ed879 (patch) | |
tree | 1752168def0a6751bc21aae14a18af2ad313d708 | |
parent | ac1408874bfe2e58b89594ca889d5840ac3816f5 (diff) | |
download | gstreamer-plugins-bad-60983fcea98b8e3ece1cadf4dd4783c9517ed879.tar.gz |
nvenc: Don't release stream lock on GstVideoEncoder::stop()
baseclass didn't take the stream lock during stop. It's valid only for
GstVideoEncoder::finish()
Closes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/912
-rw-r--r-- | sys/nvenc/gstnvbaseenc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/nvenc/gstnvbaseenc.c b/sys/nvenc/gstnvbaseenc.c index 4749c477a..f4b03cdd4 100644 --- a/sys/nvenc/gstnvbaseenc.c +++ b/sys/nvenc/gstnvbaseenc.c @@ -911,10 +911,15 @@ gst_nv_base_enc_stop_bitstream_thread (GstNvBaseEnc * nvenc, gboolean force) g_async_queue_push (nvenc->bitstream_queue, SHUTDOWN_COOKIE); } - /* temporary unlock, so other thread can find and push frame */ - GST_VIDEO_ENCODER_STREAM_UNLOCK (nvenc); + if (!force) { + /* temporary unlock during finish, so other thread can find and push frame */ + GST_VIDEO_ENCODER_STREAM_UNLOCK (nvenc); + } + g_thread_join (nvenc->bitstream_thread); - GST_VIDEO_ENCODER_STREAM_LOCK (nvenc); + + if (!force) + GST_VIDEO_ENCODER_STREAM_LOCK (nvenc); nvenc->bitstream_thread = NULL; return TRUE; |