From: Gilbok Lee Date: Thu, 3 Dec 2015 06:54:00 +0000 (+0900) Subject: Fixed svase issues X-Git-Tag: submit/tizen/20151203.225303^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=007952e0259c311dce4e3a60ce1841332749b7a1;p=platform%2Fcore%2Fmultimedia%2Flibmm-transcode.git Fixed svase issues (WGID:1089, 10102, 10104, 10106, 10994, 14462) Change-Id: Ib8d2530af9f9d274ae323cf81df7b0b9a25e1952 Signed-off-by: Gilbok Lee --- diff --git a/packaging/libmm-transcode.spec b/packaging/libmm-transcode.spec index f36dc13..35ff3f5 100644 --- a/packaging/libmm-transcode.spec +++ b/packaging/libmm-transcode.spec @@ -1,7 +1,7 @@ Name: libmm-transcode Summary: Multimedia Framework Video Transcode Library Version: 0.10 -Release: 1 +Release: 2 Group: System/Libraries License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/transcode/mm_transcode.c b/transcode/mm_transcode.c index 4759bf4..cbab70c 100755 --- a/transcode/mm_transcode.c +++ b/transcode/mm_transcode.c @@ -44,25 +44,25 @@ mm_transcode_create(MMHandleType* MMHandle) handle->decoder_vidp= g_new0 (handle_vidp_plugin_s, 1); if (!handle->decoder_vidp) { debug_error("[ERROR] - handle decoder video process bin"); - return MM_ERROR_TRANSCODE_INTERNAL; + goto ERROR5; } handle->decoder_audp= g_new0 (handle_audp_plugin_s, 1); if (!handle->decoder_audp) { debug_error("[ERROR] - handle decoder audio process bin"); - return MM_ERROR_TRANSCODE_INTERNAL; + goto ERROR4; } handle->encodebin= g_new0 (handle_encode_s, 1); if (!handle->encodebin) { debug_error("[ERROR] - handle encodebin"); - return MM_ERROR_TRANSCODE_INTERNAL; + goto ERROR3; } handle->property = g_new0 (handle_property_s, 1); if (!handle->property) { debug_error("[ERROR] - handle property"); - return MM_ERROR_TRANSCODE_INTERNAL; + goto ERROR2; } *MMHandle = (MMHandleType)handle; @@ -72,10 +72,22 @@ mm_transcode_create(MMHandleType* MMHandle) handle->property->_MMHandle = 0; } else { debug_error("handle create Fail"); - return MM_ERROR_TRANSCODE_INTERNAL; + goto ERROR1; } return ret; + +ERROR1: + TRANSCODE_FREE (handle->property); +ERROR2: + TRANSCODE_FREE (handle->encodebin); +ERROR3: + TRANSCODE_FREE (handle->decoder_audp); +ERROR4: + TRANSCODE_FREE (handle->decoder_vidp); +ERROR5: + TRANSCODE_FREE (handle); + return MM_ERROR_TRANSCODE_INTERNAL; } int diff --git a/transcode/mm_transcode_seek.c b/transcode/mm_transcode_seek.c index d46853c..f84d1e5 100755 --- a/transcode/mm_transcode_seek.c +++ b/transcode/mm_transcode_seek.c @@ -153,6 +153,11 @@ _mm_cb_encodebin_sinkpad_event_probe(GstPad *pad, GstPadProbeInfo *info, gpointe new_segment = gst_segment_copy(segment); gst_event_unref (event); + if (!new_segment) { + debug_error ("[ERROR] segment copy error"); + return GST_PAD_PROBE_REMOVE; + } + new_segment->start = 0; new_segment->stop = handle->param->duration * G_GINT64_CONSTANT(1000000); @@ -369,6 +374,11 @@ _mm_cb_transcode_bus(GstBus * bus, GstMessage * message, gpointer userdata) gchar *debug; gst_message_parse_error (message, &err, &debug); + if (!err) { + debug_warning("Fail to parse error message"); + break; + } + debug_error("[Source: %s] Error: %s", GST_OBJECT_NAME(GST_OBJECT_CAST(GST_ELEMENT(GST_MESSAGE_SRC (message)))), err->message); @@ -381,10 +391,9 @@ _mm_cb_transcode_bus(GstBus * bus, GstMessage * message, gpointer userdata) return FALSE; } - if (err) { - g_error_free (err); - err = NULL; - } + g_error_free (err); + err = NULL; + TRANSCODE_FREE(debug); TRANSCODE_FREE(handle->param); /* g_main_loop_quit (handle->loop); */ @@ -493,8 +502,6 @@ _mm_cb_transcode_bus(GstBus * bus, GstMessage * message, gpointer userdata) debug_log("[unlink] %s %d > %d", handle->param->outputfile, handle->param->start_pos, handle->property->total_length); } g_mutex_lock (handle->property->thread_mutex); - g_free(handle->param); - debug_log("g_free (param)"); handle->param->completed = TRUE; handle->property->is_busy = FALSE; g_cond_signal(handle->property->thread_cond);