summaryrefslogtreecommitdiff
path: root/src/ipc/media-thumb-ipc.c
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-07-31 01:55:23 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2017-07-31 01:55:23 (GMT)
commit064fbb7b479f2e92785662afdea8f66d1315bc64 (patch)
treef9384421d0d9f4ad8b1b3ea0d9a740f4230740a1 /src/ipc/media-thumb-ipc.c
parent32da7c25c64349bbc7fc330acb8922764e16e8c9 (diff)
downloadlibmedia-thumbnail-submit/tizen/20170801.052138.zip
libmedia-thumbnail-submit/tizen/20170801.052138.tar.gz
libmedia-thumbnail-submit/tizen/20170801.052138.tar.bz2
Change-Id: I1930be6dbccc4c7957bdb5bcd6389e77acbb51e2 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src/ipc/media-thumb-ipc.c')
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c92
1 files changed, 26 insertions, 66 deletions
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index 5faed91..63f22d4 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -1041,41 +1041,15 @@ int _media_thumb_request_raw_data_async(int msg_type, int request_id, const char
return err;
}
-int _media_thumb_request_cancel_all(bool isRaw)
+int _media_thumb_request_cancel_all()
{
int i;
int req_len = -1;
int len = 0;
+ thumbRawReq *tmp_raw_req = NULL;
- if (isRaw) {
- thumbRawReq *tmp_raw_req = NULL;
- if (g_manage_raw_queue == NULL) {
- thumb_err("manage_queue is NULL");
- if (g_request_raw_queue != NULL) {
- /* Check request queue */
- len = g_queue_get_length(g_request_raw_queue);
- if (len > 0) {
- tmp_raw_req = g_queue_peek_head(g_request_raw_queue);
- if (tmp_raw_req != NULL)
- tmp_raw_req->isCanceled = true;
- return MS_MEDIA_ERR_NONE;
- }
- }
- thumb_err("request_queue is NULL");
- return MS_MEDIA_ERR_INTERNAL;
- }
- req_len = g_queue_get_length(g_manage_raw_queue);
- for (i = 0; i < req_len; i++) {
- tmp_raw_req = g_queue_pop_tail(g_manage_raw_queue);
- if (tmp_raw_req) {
- SAFE_FREE(tmp_raw_req->path);
- SAFE_FREE(tmp_raw_req->userData);
- SAFE_FREE(tmp_raw_req);
- tmp_raw_req = NULL;
- }
- }
- g_queue_free(g_manage_raw_queue);
- g_manage_raw_queue = NULL;
+ if (g_manage_raw_queue == NULL) {
+ thumb_err("manage_queue is NULL");
if (g_request_raw_queue != NULL) {
/* Check request queue */
len = g_queue_get_length(g_request_raw_queue);
@@ -1083,45 +1057,31 @@ int _media_thumb_request_cancel_all(bool isRaw)
tmp_raw_req = g_queue_peek_head(g_request_raw_queue);
if (tmp_raw_req != NULL)
tmp_raw_req->isCanceled = true;
+ return MS_MEDIA_ERR_NONE;
}
}
- } else {
- thumbReq *tmp_req = NULL;
- if (g_manage_queue == NULL) {
- thumb_err("manage_queue is NULL");
- if (g_request_queue != NULL) {
- /* Check request queue */
- len = g_queue_get_length(g_request_queue);
- if (len > 0) {
- tmp_req = g_queue_peek_head(g_request_queue);
- if (tmp_req != NULL)
- tmp_req->isCanceled = true;
- return MS_MEDIA_ERR_NONE;
- }
- }
- thumb_err("request_queue is NULL");
- return MS_MEDIA_ERR_INTERNAL;
- }
- req_len = g_queue_get_length(g_manage_queue);
- for (i = 0; i < req_len; i++) {
- tmp_req = g_queue_pop_tail(g_manage_queue);
- if (tmp_req) {
- SAFE_FREE(tmp_req->path);
- SAFE_FREE(tmp_req->userData);
- SAFE_FREE(tmp_req);
- tmp_req = NULL;
- }
+ thumb_err("request_queue is NULL");
+ return MS_MEDIA_ERR_INTERNAL;
+ }
+ req_len = g_queue_get_length(g_manage_raw_queue);
+ for (i = 0; i < req_len; i++) {
+ tmp_raw_req = g_queue_pop_tail(g_manage_raw_queue);
+ if (tmp_raw_req) {
+ SAFE_FREE(tmp_raw_req->path);
+ SAFE_FREE(tmp_raw_req->userData);
+ SAFE_FREE(tmp_raw_req);
+ tmp_raw_req = NULL;
}
- g_queue_free(g_manage_queue);
- g_manage_queue = NULL;
- if (g_request_queue != NULL) {
- /* Check request queue */
- len = g_queue_get_length(g_request_queue);
- if (len > 0) {
- tmp_req = g_queue_peek_head(g_request_queue);
- if (tmp_req != NULL)
- tmp_req->isCanceled = true;
- }
+ }
+ g_queue_free(g_manage_raw_queue);
+ g_manage_raw_queue = NULL;
+ if (g_request_raw_queue != NULL) {
+ /* Check request queue */
+ len = g_queue_get_length(g_request_raw_queue);
+ if (len > 0) {
+ tmp_raw_req = g_queue_peek_head(g_request_raw_queue);
+ if (tmp_raw_req != NULL)
+ tmp_raw_req->isCanceled = true;
}
}