[TSAM-9237] Paused the video-player in case of speak mode 07/93707/1
authorRahul Dadhich <r.dadhich@samsung.com>
Tue, 25 Oct 2016 10:37:31 +0000 (16:07 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Tue, 25 Oct 2016 10:37:31 +0000 (16:07 +0530)
Change-Id: Id70991e7a7400bce8f5292a899ab99619daccd79
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
playview/src/core/vp-sound.c

index 10f4641..ccb7e57 100644 (file)
@@ -43,6 +43,7 @@ void vp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focu
                VideoLogError("sound_manager_get_focus_state fail");
                return;
        }
+       VideoLogDebug("Reason for change : %d and state of playback is : %d", reason_for_change, state_for_playback);
        if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
                if (reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_ALARM &&
                                reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION) {
@@ -52,11 +53,14 @@ void vp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focu
                        }
                        if ((reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_MEDIA) && (!strcmp(additional_info, "music_playing"))) {
                                vp_play_normal_view_pause_player(pPlayView);
+                       } else if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION) {
+                               vp_play_normal_view_pause_player(pPlayView);
+                               sound_manager_set_focus_reacquisition(pPlayView->stream_info, EINA_TRUE);
                        }
                }
-       } /*else {
+       } else if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION) {
                vp_play_normal_view_play_player(pPlayView);
-       }*/
+       }
 }
 
 bool vp_sound_init_session(play_view_handle pViewHandle)