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