From a13fe3ce87bdb7372a9ed8f97df44956203a93fe Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Thu, 29 Nov 2018 11:26:11 +0900 Subject: [PATCH] [Decoder] Do not die for option errors. With dynamic pipeline configurations, the mode/option properties may become incomplete. Do not die for such status if the pipeline is not active. This is critical for GUI toolkits. Fixes a subitem of #827 Signed-off-by: MyungJoo Ham --- gst/tensor_decoder/tensordec-imagelabel.c | 1 - gst/tensor_decoder/tensordec.c | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gst/tensor_decoder/tensordec-imagelabel.c b/gst/tensor_decoder/tensordec-imagelabel.c index cd16eb8..d700e04 100644 --- a/gst/tensor_decoder/tensordec-imagelabel.c +++ b/gst/tensor_decoder/tensordec-imagelabel.c @@ -160,7 +160,6 @@ _setOption (GstTensorDec * self, int opNum, const gchar * param) return TRUE; else return FALSE; - /** @todo Do not die for this */ } GST_INFO ("Property mode-option-%d is ignored", opNum + 1); diff --git a/gst/tensor_decoder/tensordec.c b/gst/tensor_decoder/tensordec.c index 6e5d891..a9961f6 100644 --- a/gst/tensor_decoder/tensordec.c +++ b/gst/tensor_decoder/tensordec.c @@ -372,9 +372,12 @@ _tensordec_process_plugin_options (GstTensorDec * self, int opnum) */ #define PROP_MODE_OPTION(opnum) \ case PROP_MODE_OPTION ## opnum: \ - self->option[opnum - 1] = g_value_dup_string (value); \ + g_free (self->option[(opnum) - 1]); \ + self->option[(opnum) - 1] = g_value_dup_string (value); \ if (self->mode == DECODE_MODE_PLUGIN) { \ - g_assert (_tensordec_process_plugin_options (self, opnum - 1) == TRUE); \ + if (_tensordec_process_plugin_options (self, (opnum) - 1) != TRUE) \ + GST_ERROR_OBJECT (self, "Configuring option for tensor-decoder failed (option %d = %s)", \ + (opnum), self->option[(opnum) - 1]); \ } \ break @@ -394,7 +397,6 @@ gst_tensordec_set_property (GObject * object, guint prop_id, break; case PROP_MODE:{ int i; - gboolean retval = TRUE; TensorDecDef *decoder; temp_string = g_value_dup_string (value); decoder = tensordec_find (temp_string); @@ -423,8 +425,7 @@ gst_tensordec_set_property (GObject * object, guint prop_id, silent_debug ("tensor_decoder plugin mode (%s)\n", temp_string); for (i = 0; i < TensorDecMaxOpNum; i++) - retval &= _tensordec_process_plugin_options (self, i); - g_assert (retval == TRUE); + _tensordec_process_plugin_options (self, i); self->mode = DECODE_MODE_PLUGIN; self->output_type = self->decoder->type; } else { -- 2.7.4