diff options
author | Seungha Yang <seungha.yang@navercorp.com> | 2019-03-25 22:24:17 +0900 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-02 11:01:22 +0100 |
commit | 592f0cf0e987ad54de9edeac268b8c9f2a184615 (patch) | |
tree | 409fbf8bab24ab3abfece421e2b47e8c4d45c26c | |
parent | e1e2ff9884610ebbe33d72f5d33028838c34a400 (diff) | |
download | gstreamer-plugins-bad-592f0cf0e987ad54de9edeac268b8c9f2a184615.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 8bc446eb7..796741e55 100644 --- a/sys/nvenc/gstnvbaseenc.c +++ b/sys/nvenc/gstnvbaseenc.c @@ -925,10 +925,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; |