Fixed TSAM-9723 Abnormal Multimedia Controller 79/97279/1
authorbhutani.92 <bhutani.92@samsung.com>
Sat, 12 Nov 2016 09:30:58 +0000 (15:00 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Sat, 12 Nov 2016 09:30:58 +0000 (15:00 +0530)
Change-Id: I9323a4449ce704cddcd8a4f4ca4246c7456594b1
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
src/common/mp-app.c
src/core/mp-player-mgr.c
src/widget/mp-minicontroller.c

index 20661117ff610622ee547720ec4d16c11c2f0902..43c1dab860a4db8de79e3756e9c7184d7c281b4f 100755 (executable)
@@ -266,6 +266,7 @@ _mp_add_available_route_changed_cb(sound_device_h  device, bool available, void
 
        if (!available) {
         struct appdata *ad = user_data;
+        MP_CHECK(ad);
 
         mp_player_mgr_pause(ad);
     }
@@ -277,6 +278,21 @@ _mp_app_active_device_chaged_cb(sound_device_h  in, sound_device_changed_info_e
        EVENT_TRACE("input=[0x%x], output=[0x%x]", in, out);
        MP_CHECK(gNotiPipe);
 
+       struct appdata *ad = user_data;
+       MP_CHECK(ad);
+
+       int current_pid = mp_setting_get_nowplaying_id();
+       if (current_pid && current_pid != getpid()) {
+               DEBUG_TRACE("Some other player playing currently");
+               ad->paused_by_user = true;
+               if (ad->win_minicon) {
+                       mp_minicontroller_hide(ad);
+               }
+               if (ad->win_lockmini) {
+                       mp_lockscreenmini_hide(ad);
+               }
+       }
+
        mp_app_pipe_data_s pipe_data;
        memset(&pipe_data, 0, sizeof(mp_app_pipe_data_s));
        pipe_data.type = MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED;
index 0f31253c6daadbc174422940940c5dc92a49c582..30f6ea6b6bf220c193c20fbddd7d892796f9689c 100755 (executable)
@@ -1157,18 +1157,6 @@ void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focu
        if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
                mp_player_mgr_pause(ad);
 
-               int current_pid = mp_setting_get_nowplaying_id();
-               if (current_pid && current_pid != getpid()) {
-                       DEBUG_TRACE("Some other player playing currently");
-                       ad->paused_by_user = true;
-                       if (ad->win_minicon) {
-                               mp_minicontroller_hide(ad);
-                       }
-                       if (ad->win_lockmini) {
-                               mp_lockscreenmini_hide(ad);
-                       }
-               }
-
                sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state);
                DEBUG_TRACE("reason for change is %d", reason_for_change);
                if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP ||
index 75c7385f26273479450d5df52a8ae62da158eabb..8cc50c66cae70319356f3d644dccb252fb77bed4 100755 (executable)
@@ -808,7 +808,7 @@ _mp_minicontroller_update_layout(struct appdata *ad, bool landscape)
                DEBUG_TRACE("angle: 90 or 270");
                ad->minicontroller_layout = _load_edj(ad->win_minicon, MINICON_EDJ_NAME, "music-minicontroller-ld");
        } else {
-               DEBUG_TRACE("angel: 0");
+               DEBUG_TRACE("angle: 0");
                ad->minicontroller_layout = _load_edj(ad->win_minicon, MINICON_EDJ_NAME, "music-minicontroller");
        }