views:

251

answers:

0

Hi I'm having a problem with the VideoView - launching activity with VideoView from another activity, video plays, press back - i'm in original activity. But sometimes then i came back from the Video activity - screen is frozen, until i go back again to another previous activity. In such case i see in the log

01-27 19:13:11.062: DEBUG/PlayerDriver(51): buffering (23)
01-27 19:13:11.322: DEBUG/PlayerDriver(51): buffering (24)
01-27 19:13:11.612: DEBUG/PlayerDriver(51): buffering (25)
01-27 19:13:11.902: DEBUG/PlayerDriver(51): buffering (26)
01-27 19:13:12.162: DEBUG/PlayerDriver(51): buffering (27)
01-27 19:13:12.322: ERROR/QCvdec(51): Flush VDL_stats_q: stats_ptr 0x1892a8
01-27 19:13:12.612: ERROR/QCOmxcore(51): OMXCORE API :  Free Handle 13fa54
01-27 19:13:12.632: ERROR/QCOmxcore(51):  Unloading the dynamic library for OMX.qcom.video.decoder.avc
01-27 19:13:12.682: INFO/WindowManager(74): Setting rotation to 0, animFlags=0
01-27 19:13:12.712: INFO/WindowManager(74): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=2/1/2 nav=3 orien=1 layout=18}
01-27 19:13:12.732: WARN/WindowManager(74): performLayoutAndPlaceSurfacesLocked called while in layout
01-27 19:13:12.742: WARN/WindowManager(74): performLayoutAndPlaceSurfacesLocked called while in layout

my VideoActivity is pretty simple ( it's work in progress )

public class VideoViewActivity extends Activity {


    private String path = "";
    private VideoView mVideoView;
    private static final String MEDIA_URL = "media_url";

    @Override
    public void onCreate(Bundle icicle) {

        super.onCreate(icicle);
        setContentView(R.layout.videoview);
        mVideoView = (VideoView)findViewById(R.id.surface_view);
        path = getIntent().getStringExtra(MEDIA_URL);
    }

    @Override
    public void onResume() {

        super.onResume();
        mVideoView.setVideoPath(path);
        mVideoView.setMediaController(new MediaController(this));
        mVideoView.requestFocus();
        mVideoView.start();
    }

    @Override
    public void onPause() {

        super.onPause();
        mVideoView.stopPlayback();

        mVideoView.setMediaController(null);
    }
}

So my question is what is the cause of performLayoutAndPlaceSurfacesLocked ? Am I not resetting something before the exit ? layout is basically videoview.xml from SDK ApiDemos.

EDIT : it has something to do with orientation changes. Activity orientation is set to landscape. If activity i'm calling VideoViewActivity from is in landscape at the moment of the call - it's not happening. Setting VideoViewActivity to ignore orientation changes didn't help.