merging tizen_4.0 to tizen 87/170487/2
authorVikas Kumar Agrawal <vikas.ag@samsung.com>
Tue, 20 Feb 2018 07:25:44 +0000 (12:55 +0530)
committerVikas Kumar Agrawal <vikas.ag@samsung.com>
Tue, 20 Feb 2018 09:03:42 +0000 (14:33 +0530)
Change-Id: I42866cb1056967c063b74dc1e732bc0cc380578c

1  2 
music-chooser/src/mc-common.c
src/common/mp-app.c
src/common/mp-common.c
src/common/mp-edit-callback.c
src/core/mp-setting-ctrl.c
src/mp-main.c
src/widget/mp-artist-detail-list.c
src/widget/mp-lyric.c

Simple merge
Simple merge
@@@ -1059,85 -858,13 +858,93 @@@ void mp_common_show_player_view_after_p
  
        endfunc;
  }
-       if (ad->playlist_mgr->shuffle_state) {
-               ad->playlist_mgr->list = ad->playlist_mgr->shuffle_list;
-       } else {
-               ad->playlist_mgr->list = ad->playlist_mgr->normal_list;
 +
 +void mp_common_play_track_list_with_song_uid(mp_list_item_data_t* item, Evas_Object *genlist,
 +              char *item_uid, char *item_uri)
 +{
 +      startfunc;
 +      MP_CHECK(item);
 +      MP_CHECK(item_uid);
 +      MP_CHECK(item_uri);
 +
 +      struct appdata *ad = mp_util_get_appdata();
 +      MP_CHECK(ad);
 +
 +      ad->hide_player_view = true;
 +      ad->paused_by_user = false;
 +
 +      if (!ad->playlist_mgr) {
 +              mp_common_create_playlist_mgr();
 +      }
 +
 +      PROFILE_IN("mp_playlist_mgr_clear");
 +      mp_playlist_mgr_clear(ad->playlist_mgr);
 +      PROFILE_OUT("mp_playlist_mgr_clear");
 +
 +      Elm_Object_Item *gli2 = NULL;
 +      mp_plst_item* plst_item = NULL;
 +      gli2 = elm_genlist_first_item_get(genlist);
 +      while (gli2) {
 +              if (elm_genlist_item_select_mode_get(gli2) !=
 +                              ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) {
 +                      mp_list_item_data_t *item_data =
 +                                      elm_object_item_data_get(gli2);
 +                      if (item_data
 +                                      && item_data->item_type == MP_LIST_ITEM_TYPE_NORMAL) {
 +                              if (item_data->group_type == MP_GROUP_NONE
 +                                              || item_data->group_type == MP_GROUP_BY_ALLSHARE) {
 +                                      char *uri = NULL;
 +                                      char *uid = NULL;
 +                                      char *title = NULL;
 +                                      char *artist = NULL;
 +
 +                                      mp_track_type track_type = MP_TRACK_URI;
 +                                      mp_media_info_get_media_id(item_data->handle, &uid);
 +                                      if (g_strcmp0(item_uid, uid)) {
 +                                              gli2 = elm_genlist_item_next_get(gli2);
 +                                              continue;
 +                                      }
 +                                      mp_media_info_get_file_path(item_data->handle, &uri);
 +                                      mp_media_info_get_title(item_data->handle, &title);
 +                                      mp_media_info_get_artist(item_data->handle, &artist);
 +
 +                                      mp_storage_type_e storage;
 +                                      mp_media_info_get_storage_type(item_data->handle,
 +                                                      &storage);
 +
 +                                      plst_item =
 +                                                      mp_playlist_mgr_item_append(ad->playlist_mgr, uri,
 +                                                                      uid, title, artist,
 +                                                                      track_type);
 +                              }
 +                      }
 +              }
 +              gli2 = elm_genlist_item_next_get(gli2);
 +      }
 +
++      if (ad->playlist_mgr) {
++              if (ad->playlist_mgr->shuffle_state) {
++                      ad->playlist_mgr->list = ad->playlist_mgr->shuffle_list;
++              } else {
++                      ad->playlist_mgr->list = ad->playlist_mgr->normal_list;
++              }
 +      }
 +      mp_playlist_mgr_set_current(ad->playlist_mgr, plst_item);
 +
 +      PROFILE_IN("mp_play_destory");
 +      mp_play_fast_destory(ad);
 +      PROFILE_OUT("mp_play_destory");
 +
 +      mp_play_new_file(ad, TRUE);
 +}
 +
+ /*
+ * Play the songs with playlist id
+ * @param  item Music Player list item
+ * @param  genlist Genlist item
+ * @param  playlist_id Playlist id
+ * @return void
+ */
  void mp_common_play_track_list_with_playlist_id(mp_list_item_data_t * item,
                Evas_Object * genlist,
                int playlist_id)
@@@ -1842,8 -1514,11 +1594,12 @@@ bool mp_common_parse_view_operation(app
  
        if (!strcmp(APP_CONTROL_OPERATION_VIEW, operation)) {
                struct appdata *ad = mp_util_get_appdata();
 +              MP_CHECK_FALSE(ad);
                char *value = NULL;
+               if (!ad) {
+                       ERROR_TRACE("Appdata is NULL");
+                       goto END;
+               }
  
                ad->samsung_link = false;
  
Simple merge
diff --cc src/mp-main.c
@@@ -1385,17 -1385,6 +1386,17 @@@ static void mp_terminate(void *data
        mp_lockscreenmini_destroy(ad);
  #endif
  
-               while(list){
 +      GList *list = ad->checkedList;
 +      if (list) {
++              while (list) {
 +                      char *data = list->data;
 +                      IF_FREE(data);
 +                      list = g_list_next(list);
 +              }
 +              g_list_free(list);
 +              list = NULL;
 +      }
 +
        mp_player_mgr_vol_type_unset();
        mp_player_mgr_safety_volume_set(0);
  
Simple merge
Simple merge