[0.6.35] update internal focus status right after acquring/releasing focus
[platform/core/multimedia/libmm-player.git] / src / mm_player_priv.c
index 6ded73d..bc7bd18 100644 (file)
@@ -4539,7 +4539,6 @@ void __mmplayer_gst_set_audiosink_property(mm_player_t* player, MMHandleType att
        gint stream_id = 0;
        gchar stream_props[MAX_PROPS_LEN] = {0,};
        GstStructure *props = NULL;
-       gint stream_focus_status = 0;
 
        /* set volume table
         * It should be set after player creation through attribute.
@@ -4552,14 +4551,15 @@ void __mmplayer_gst_set_audiosink_property(mm_player_t* player, MMHandleType att
        if (!stream_type) {
                LOGE("stream_type is null.\n");
        } else {
-               if (_mmplayer_is_using_internal_sound_focus(&player->sound_focus))
-                       stream_focus_status = 1;
-
-               snprintf(stream_props, sizeof(stream_props)-1, "props,media.role=%s, media.parent_id=%d, media.focus_status=%d",
-                               stream_type, stream_id, stream_focus_status);
+               if (player->sound_focus.focus_id)
+                       snprintf(stream_props, sizeof(stream_props)-1, "props,media.role=%s, media.parent_id=%d, media.focus_id=%d",
+                                       stream_type, stream_id, player->sound_focus.focus_id);
+               else
+                       snprintf(stream_props, sizeof(stream_props)-1, "props,media.role=%s, media.parent_id=%d",
+                                       stream_type, stream_id);
                props = gst_structure_from_string(stream_props, NULL);
                g_object_set(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "stream-properties", props, NULL);
-               LOGI("stream_id[%d], stream_type[%s], stream_focus[%d], result[%s].\n", stream_id, stream_type, stream_focus_status, stream_props);
+               LOGI("stream_type[%s], stream_id[%d], focus_id[%d], result[%s].\n", stream_type, stream_id, player->sound_focus.focus_id, stream_props);
        }
 
        mm_attrs_get_int_by_name(attrs, "sound_latency_mode", &latency_mode);
@@ -8389,6 +8389,8 @@ DONE:
        player->sound_focus.cb_pending = FALSE;
 
 EXIT:
+       if (mm_sound_update_focus_status(id, 0))
+               LOGE("failed to update focus status\n");
        MMPLAYER_CMD_UNLOCK(player);
        LOGW("dispatched");
        return;