From 30d0bc15151727b8a90605dfe453cf535408a3f4 Mon Sep 17 00:00:00 2001 From: Gilbok Lee Date: Wed, 16 Mar 2016 13:39:37 +0900 Subject: [PATCH] Fix build warnings Change-Id: Icfc29959faafe7dda1278dce769adcc9bf3b8ebb Signed-off-by: Gilbok Lee --- packaging/libmm-transcode.spec | 2 +- transcode/mm_transcode_pipeline.c | 9 ++++++--- transcode/mm_transcode_seek.c | 11 +++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packaging/libmm-transcode.spec b/packaging/libmm-transcode.spec index 4ac3062..9c446fd 100644 --- a/packaging/libmm-transcode.spec +++ b/packaging/libmm-transcode.spec @@ -43,7 +43,7 @@ cp %{SOURCE1001} . %build ./autogen.sh -CFLAGS="$CFLAGS -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" -D_MM_PROJECT_FLOATER" \ +CFLAGS="$CFLAGS -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" -D_MM_PROJECT_FLOATER -Werror" \ LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed" \ %configure diff --git a/transcode/mm_transcode_pipeline.c b/transcode/mm_transcode_pipeline.c index fa2003e..574d76c 100755 --- a/transcode/mm_transcode_pipeline.c +++ b/transcode/mm_transcode_pipeline.c @@ -123,19 +123,22 @@ int _mm_cleanup_pipeline(handle_s *handle) } if (handle->property->thread_mutex) { - g_mutex_free(handle->property->thread_mutex); + g_mutex_clear(handle->property->thread_mutex); + g_free(handle->property->thread_mutex); handle->property->thread_mutex = NULL; debug_log("Success - free (thread_mutex)"); } if (handle->property->thread_cond) { - g_cond_free(handle->property->thread_cond); + g_cond_clear(handle->property->thread_cond); + g_free(handle->property->thread_cond); handle->property->thread_cond = NULL; debug_log("Success - free (thread_cond)"); } if (handle->property->thread_exit_mutex) { - g_mutex_free(handle->property->thread_exit_mutex); + g_mutex_clear(handle->property->thread_exit_mutex); + g_free(handle->property->thread_exit_mutex); handle->property->thread_exit_mutex = NULL; debug_log("Success - free (thread_exit_mutex)"); } diff --git a/transcode/mm_transcode_seek.c b/transcode/mm_transcode_seek.c index b198539..0b9a45b 100755 --- a/transcode/mm_transcode_seek.c +++ b/transcode/mm_transcode_seek.c @@ -1210,14 +1210,16 @@ int _mm_transcode_thread(handle_s *handle) } if (!handle->property->thread_mutex) { - handle->property->thread_mutex = g_mutex_new(); + handle->property->thread_mutex = g_new(GMutex, 1); + g_mutex_init(handle->property->thread_mutex); debug_log("create thread_mutex: 0x%2x", handle->property->thread_mutex); } else { debug_error("ERROR - thread_mutex is already created"); } if (!handle->property->thread_exit_mutex) { - handle->property->thread_exit_mutex = g_mutex_new(); + handle->property->thread_exit_mutex = g_new(GMutex, 1); + g_mutex_init(handle->property->thread_exit_mutex); debug_log("create exit mutex: 0x%2x", handle->property->thread_exit_mutex); } else { debug_error("ERROR - thread_exit_mutex is already created"); @@ -1232,7 +1234,8 @@ int _mm_transcode_thread(handle_s *handle) } if (!handle->property->thread_cond) { - handle->property->thread_cond = g_cond_new(); + handle->property->thread_cond = g_new(GCond, 1); + g_cond_init(handle->property->thread_cond); debug_log("create thread cond: 0x%2x", handle->property->thread_cond); } else { debug_error("thread cond is already created"); @@ -1240,7 +1243,7 @@ int _mm_transcode_thread(handle_s *handle) /* create threads */ debug_log("create thread"); - handle->property->thread = g_thread_create((GThreadFunc)_mm_transcode_thread_repeate, (gpointer)handle, TRUE, NULL); + handle->property->thread = g_thread_new(NULL, (GThreadFunc)_mm_transcode_thread_repeate, (gpointer)handle); if (!handle->property->thread) { debug_error("ERROR - create thread"); return MM_ERROR_TRANSCODE_INTERNAL; -- 2.7.4