title: setVideoSurfaceTexture failed : -22 in mediaplayer
body: <p>I try to play multiple videos in loop using MediaPlayer (Android ICS) and change the videos each time  when oncompletion() called.</p>
  
  <p>It works great but after a random time the application freeze and I get the error :</p>
  
  <blockquote>
    <p>[SurfaceView] connect : already connected (cur=3, req=3)
    setVideoSurfaceTexture failed : -22</p>
  </blockquote>
  
  <p>When this error happen, internally it call the reset player</p>
  
  <p>ref : mediaplayer.cpp</p>
  
  <pre><code>if (err != OK) {
      LOGE("setVideoSurfaceTexture failed: %d", err);
      // Note that we must do the reset before disconnecting from the ANW.
      // Otherwise queue/dequeue calls could be made on the disconnected
      // ANW, which may result in errors.
      reset();
      disconnectNativeWindow();
      return err;
  }
  </code></pre>
  
  <p>as per my code i get the notification for onprepared() and start playing. </p>
  
  <p>Actually there is no playback due to this err.</p>
  
  <p>So i try to reset the mediaplayer and call prepare() when this problem happened and mediaplayer is not playing, but i am not able to capture this bug ( mp.isPlaying()->true (bec'z called start() in onprepared()).</p>
  
  <p>i try the logic like</p>
  
  <pre><code>onprepared() {
      mp.start();
      if (pbm : [SurfaceView] connect : already connected (cur=3, req=3)
                                        setVideoSurfaceTexture failed : -22  ) {
          reset the mediaplayer source and call prepare
      }
  }
  </code></pre>
  
  <p>how can i locate this bug to restart the mediaplayer again?</p>