[0.6.8] do not check bus err msg if the error is already posted 88/94288/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 28 Oct 2016 05:06:08 +0000 (14:06 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Fri, 28 Oct 2016 05:06:08 +0000 (14:06 +0900)
Change-Id: I5fe6b4acce0522b3f2fc15b5e4d12933cce35ced

packaging/libmm-player.spec
src/mm_player_priv.c

index fb09a13..2c9ff87 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.7
+Version:    0.6.8
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index de792b3..aa57339 100644 (file)
@@ -7442,14 +7442,18 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
 
                        LOGE("failed to set state to PAUSED");
 
+                       if (player->msg_posted) {
+                               LOGE("error msg is already posted.");
+                               return ret;
+                       }
+
                        timer = g_timer_new();
                        g_timer_start(timer);
 
                        GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst));
-                       gboolean got_msg = FALSE;
-                       /* check if gst error posted or not */
+
                        do {
-                               msg = gst_bus_timed_pop(bus, GST_SECOND / 2);
+                               msg = gst_bus_timed_pop(bus, 100 * GST_MSECOND);
                                if (msg) {
                                        if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ERROR) {
                                                GError *error = NULL;
@@ -7475,13 +7479,11 @@ int __gst_pause(mm_player_t* player, gboolean async) // @
                                                        else if (error->domain == GST_CORE_ERROR)
                                                                ret = __gst_handle_core_error(player, error->code);
                                                }
-
-                                               got_msg = TRUE;
                                                player->msg_posted = TRUE;
                                        }
                                        gst_message_unref(msg);
                                }
-                       } while (!got_msg && (g_timer_elapsed(timer, NULL) < MAX_TIMEOUT_SEC));
+                       } while (!player->msg_posted && (g_timer_elapsed(timer, NULL) < MAX_TIMEOUT_SEC));
                        /* clean */
                        gst_object_unref(bus);
                        g_timer_stop(timer);