From 26f0b0b20b71d2b4c7874911d49577a7e92a52ef Mon Sep 17 00:00:00 2001 From: "jijoong.moon" Date: Wed, 27 Mar 2019 18:54:04 +0900 Subject: [PATCH] [TENSORREPO] Fix hanging while waiting pulled signal when eos. There is hanging error when it is waiting pulled signal. In the case of EOS(End of Stream), there is no pulling procedure but it is required to get signal to get out the while loop. **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon --- gst/nnstreamer/tensor_repo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gst/nnstreamer/tensor_repo.c b/gst/nnstreamer/tensor_repo.c index c1f895b..8815df3 100644 --- a/gst/nnstreamer/tensor_repo.c +++ b/gst/nnstreamer/tensor_repo.c @@ -225,15 +225,15 @@ gst_tensor_repo_set_buffer (guint nth, guint o_nth, GstBuffer * buffer, GstTensorRepoData *data = gst_tensor_repo_get_repodata (nth); + while (data->buffer != NULL && !data->eos) { + GST_TENSOR_REPO_WAIT_PULL (nth); + } + if (data->eos) { GST_TENSOR_REPO_UNLOCK (nth); return FALSE; } - while (data->buffer != NULL) { - GST_TENSOR_REPO_WAIT_PULL (nth); - } - data->buffer = gst_buffer_copy (buffer); GstMetaRepo *meta = GST_META_REPO_ADD (data->buffer); @@ -301,6 +301,7 @@ gst_tensor_repo_set_eos (guint nth) GstTensorRepoData *data = gst_tensor_repo_get_repodata (nth); data->eos = TRUE; GST_TENSOR_REPO_SIGNAL_PUSH (nth); + GST_TENSOR_REPO_SIGNAL_PULL (nth); GST_TENSOR_REPO_UNLOCK (nth); return data->eos; } -- 2.7.4