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;
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
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);
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);
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); */
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);