Fix state changed event routine 71/109871/1 accepted/tizen/common/20170117.175047 accepted/tizen/ivi/20170118.041357 accepted/tizen/mobile/20170118.041258 accepted/tizen/tv/20170118.041316 accepted/tizen/wearable/20170118.041330 submit/tizen/20170117.102244
authorSeokHoon Lee <andy.shlee@samsung.com>
Thu, 12 Jan 2017 05:28:35 +0000 (14:28 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Thu, 12 Jan 2017 05:55:36 +0000 (14:55 +0900)
It never happen to callback function,
because of previous variable.

Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I6c1a63f45a73cd7f28ed163114032c109468883a

packaging/capi-media-streamrecorder.spec
src/streamrecorder.c

index aa09e45..4f68fe9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-streamrecorder
 Summary:    A Streamrecorder library in Tizen Native API
-Version:    0.0.7
+Version:    0.0.8
 Release:    0
 Group:      Multimedia/Other
 License:    Apache-2.0
index 791bf5e..da0707f 100644 (file)
@@ -901,7 +901,6 @@ static int __mm_streamrecorder_msg_cb(int message, void *param, void *user_data)
        streamrecorder_s * handle = (streamrecorder_s *)user_data;
        MMMessageParamType *m = (MMMessageParamType *)param;
        streamrecorder_notify_e notification = STREAMRECORDER_NOTIFY_NONE;
-       streamrecorder_state_e previous_state;
        streamrecorder_recording_limit_type_e type;
        int streamrecorder_error = 0;
        switch (message) {
@@ -909,12 +908,13 @@ static int __mm_streamrecorder_msg_cb(int message, void *param, void *user_data)
                LOGW("not supported message");
                break;
        case MM_MESSAGE_STREAMRECORDER_STATE_CHANGED:
-               previous_state = handle->state;
                notification = STREAMRECORDER_NOTIFY_STATE_CHANGED;
-               if (previous_state != handle->state && handle->user_cb[_STREAMRECORDER_EVENT_TYPE_NOTIFY])
-                       ((streamrecorder_notify_cb)handle->user_cb[_STREAMRECORDER_EVENT_TYPE_NOTIFY])(previous_state, handle->state, notification, handle->user_data[_STREAMRECORDER_EVENT_TYPE_NOTIFY]);
-
+               if (handle->user_cb[_STREAMRECORDER_EVENT_TYPE_NOTIFY])
+                       ((streamrecorder_notify_cb)handle->user_cb[_STREAMRECORDER_EVENT_TYPE_NOTIFY])(
+                                       m->state.previous, m->state.current, notification,
+                                       handle->user_data[_STREAMRECORDER_EVENT_TYPE_NOTIFY]);
                break;
+
        case MM_MESSAGE_STREAMRECORDER_MAX_SIZE:
        case MM_MESSAGE_STREAMRECORDER_NO_FREE_SPACE:
        case MM_MESSAGE_STREAMRECORDER_TIME_LIMIT: