#define ADAPTIVE_VARIANT_DEFAULT_VALUE -1 /* auto */
+#define PLAYER_BUS_MSG_DEFAULT_TIMEOUT 500 /* bus msg wait timeout */
+#define PLAYER_BUS_MSG_PREPARE_TIMEOUT 100
+
/*---------------------------------------------------------------------------
| LOCAL CONSTANT DEFINITIONS: |
---------------------------------------------------------------------------*/
MMPLAYER_FENTER();
MMPLAYER_RETURN_IF_FAIL(player);
+ player->bus_msg_timeout = PLAYER_BUS_MSG_DEFAULT_TIMEOUT;
+
/* destroy the gst bus msg thread */
if (player->bus_msg_thread) {
MMPLAYER_BUS_MSG_THREAD_LOCK(player);
while (!player->bus_msg_thread_exit) {
msg = gst_bus_pop(bus);
if (msg == NULL) {
- /* set the max timeout as 500 ms */
- MMPLAYER_BUS_MSG_THREAD_WAIT_UNTIL(player, (g_get_monotonic_time() + 500 * G_TIME_SPAN_MILLISECOND));
+ int timeout = (player->bus_msg_timeout > 0) ? (player->bus_msg_timeout) : (PLAYER_BUS_MSG_DEFAULT_TIMEOUT);
+ MMPLAYER_BUS_MSG_THREAD_WAIT_UNTIL(player, (g_get_monotonic_time() + timeout * G_TIME_SPAN_MILLISECOND));
continue;
}
case GST_STATE_PAUSED:
{
gboolean prepare_async = FALSE;
+ player->bus_msg_timeout = PLAYER_BUS_MSG_DEFAULT_TIMEOUT;
if (!player->audio_cb_probe_id && player->set_mode.pcm_extraction && !player->audio_stream_render_cb_ex)
__mmplayer_configure_audio_callback(player);
case GST_STATE_PLAYING:
{
+ player->bus_msg_timeout = PLAYER_BUS_MSG_DEFAULT_TIMEOUT;
+
if (MMPLAYER_IS_STREAMING(player)) {
// managed prepare async case when buffering is completed
// pending state should be reset otherwise, it's still playing even though it's resumed after bufferging.
g_mutex_init(&player->bus_msg_thread_mutex);
g_cond_init(&player->bus_msg_thread_cond);
player->bus_msg_thread_exit = FALSE;
+ player->bus_msg_timeout = PLAYER_BUS_MSG_DEFAULT_TIMEOUT;
player->bus_msg_thread =
g_thread_try_new("gst_bus_msg_thread", __mmplayer_gst_bus_msg_thread, (gpointer)player, NULL);
if (!player->bus_msg_thread) {
else
ret = __mmplayer_realize_streaming_ext(player);
+ player->bus_msg_timeout = PLAYER_BUS_MSG_PREPARE_TIMEOUT;
+ MMPLAYER_BUS_MSG_THREAD_SIGNAL(player);
+
MMPLAYER_FLEAVE();
return ret;