[TSAM-9246] changing the init logic for sound manager 00/93800/1
authorRahul Dadhich <r.dadhich@samsung.com>
Wed, 26 Oct 2016 04:22:50 +0000 (09:52 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Wed, 26 Oct 2016 04:22:50 +0000 (09:52 +0530)
Change-Id: Iab72cbec961c5205bc3f4827497189013fa65900
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
playview/src/vp-play-view.c

index e443b7e..3ceb924 100644 (file)
@@ -2002,22 +2002,24 @@ bool vp_play_view_realize(play_view_handle pViewHandle)
 
        vp_play_normal_view_key_create(pPlayView, pPlayView->pNormalView);
        //vp_play_normal_view_set_share_panel_state(pPlayView->pNormalView);
-       vp_sound_init_session(pViewHandle);
-       sound_stream_focus_state_e state_for_playback;
-       sound_stream_focus_state_e state_for_recording;
-       int ret = -1;
-       ret = sound_manager_get_focus_state(pPlayView->stream_info, &state_for_playback, &state_for_recording);
-       if (ret != SOUND_MANAGER_ERROR_NONE) {
-               VideoLogError("failed to get focus state error[%x]", ret);
-               }
-       if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
-               error = sound_manager_acquire_focus(pPlayView->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
-               if (error != SOUND_MANAGER_ERROR_NONE) {
-                       VideoLogError("failed to acquire focus [%x]", error);
-               }
-               sound_manager_get_focus_reacquisition(pPlayView->stream_info, &pPlayView->reacquire_state);
-               if (pPlayView->reacquire_state == EINA_FALSE)
-                       sound_manager_set_focus_reacquisition(pPlayView->stream_info, EINA_TRUE);
+       if (!vp_play_normal_view_is_audio_only(pPlayView)) {
+               vp_sound_init_session(pViewHandle);
+               sound_stream_focus_state_e state_for_playback;
+               sound_stream_focus_state_e state_for_recording;
+               int ret = -1;
+               ret = sound_manager_get_focus_state(pPlayView->stream_info, &state_for_playback, &state_for_recording);
+               if (ret != SOUND_MANAGER_ERROR_NONE) {
+                       VideoLogError("failed to get focus state error[%x]", ret);
+               }
+               if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
+                       error = sound_manager_acquire_focus(pPlayView->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+                       if (error != SOUND_MANAGER_ERROR_NONE) {
+                               VideoLogError("failed to acquire focus [%x]", error);
+                       }
+                       sound_manager_get_focus_reacquisition(pPlayView->stream_info, &pPlayView->reacquire_state);
+                       if (pPlayView->reacquire_state == EINA_FALSE)
+                               sound_manager_set_focus_reacquisition(pPlayView->stream_info, EINA_TRUE);
+               }
        }
        if (pPlayView->bRealized == TRUE) {
                VideoLogWarning("Already Realize state");