Program: 110003
Project: 110003
Buggy source:
private void pvInit(ViewGroup playerv,ViewGroup playerLDrawer,SurfaceView surfacev){
  mMp.addPlayerStateListener(this,new YTPlayer.PlayerStateListener(){
    @Override public void onStateChanged(    YTPlayer.MPState from,    int fromFlag,    YTPlayer.MPState to,    int toFlag){
      pvConfigureAll(mPlayerv,mPlayerLDrawer,from,fromFlag,to,toFlag);
      notiConfigure(from,fromFlag,to,toFlag);
    }
    @Override public void onBufferingChanged(    int percent){
      mUpdateProg.updateSecondary(percent);
    }
  }
);
  ViewGroup progv=(ViewGroup)playerv.findViewById(R.id.mplayer_progress);
  SeekBar sb=(SeekBar)progv.findViewById(R.id.mplayer_seekbar);
  sb.setMax(SEEKBAR_MAX);
  sb.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
      mMp.playerSeekTo((int)(seekBar.getProgress() * (long)mMp.playerGetDuration() / SEEKBAR_MAX));
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
    }
  }
);
  mUpdateProg.setProgressView(progv);
  if (null != playerLDrawer) {
    ListView lv=(ListView)playerLDrawer.findViewById(R.id.mplayer_list);
    lv.setOnItemClickListener(new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> parent,      View view,      int position,      long id){
        if (!mMp.hasActiveVideo())         return;
        mMp.startVideoAt(position);
      }
    }
);
    mMp.addVideosStateListener(this,new YTPlayer.VideosStateListener(){
      @Override public void onStopped(      YTPlayer.StopState state){
        boolean needToNotification=true;
        CharSequence msg="String_Node_Str";
switch (state) {
case DONE:
          needToNotification=false;
        msg=mRes.getText(R.string.msg_playing_done);
      break;
case FORCE_STOPPED:
    needToNotification=false;
  msg=mRes.getText(R.string.msg_playing_stopped);
break;
case NETWORK_UNAVAILABLE:
msg=mRes.getText(R.string.err_network_unavailable);
break;
case UNKNOWN_ERROR:
msg=mRes.getText(R.string.msg_playing_err_unknown);
break;
}
if (null != mPlayerv) {
TextView titlev=(TextView)mPlayerv.findViewById(R.id.mplayer_title);
pvSetTitle(titlev,mRes.getText(R.string.msg_playing_done));
}
if (needToNotification) NotiManager.get().putPlayerNotification(NotiManager.NotiType.ALERT,(String)msg);
}
@Override public void onStarted(){
if (null != mPlayerv) pvEnableLDrawer(mPlayerLDrawer);
}
@Override public void onChanged(){
if (null != mPlayerv) pvConfigureControl((ViewGroup)mPlayerv.findViewById(R.id.mplayer_control),YTPlayer.MPState.INVALID,YTPlayer.MPSTATE_FLAG_IDLE,mMp.playerGetState(),mMp.playerGetStateFlag());
if (null == mPlayerLDrawer) return;
if (mMp.hasActiveVideo()) {
ListView lv=(ListView)mPlayerLDrawer.findViewById(R.id.mplayer_list);
YTPlayerVideoListAdapter adapter=(YTPlayerVideoListAdapter)lv.getAdapter();
if (null != adapter) adapter.setVidArray(mMp.getVideoList());
}
 else pvDisableLDrawer(mPlayerLDrawer);
}
}
);
final SlidingDrawer drawer=(SlidingDrawer)playerLDrawer.findViewById(R.id.mplayer_ldrawer);
drawer.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener(){
@Override public void onDrawerOpened(){
if (!mMp.hasActiveVideo()) return;
ListView lv=(ListView)mPlayerLDrawer.findViewById(R.id.mplayer_list);
int topPos=mMp.getActiveVideoIndex() - 1;
if (topPos < 0) topPos=0;
lv.setSelectionFromTop(topPos,0);
}
}
);
}
pvEnableLDrawer(playerLDrawer);
pvSetupStatusBar(playerv);
pvSetupControlButton(playerv);
mUpdateProg.update(mMp.playerGetDuration(),mMp.playerGetPosition());
pvConfigureAll(playerv,playerLDrawer,YTPlayer.MPState.INVALID,YTPlayer.MPSTATE_FLAG_IDLE,mMp.playerGetState(),mMp.playerGetStateFlag());
}

Fixed version (ground truth):
private void pvInit(ViewGroup playerv,ViewGroup playerLDrawer,SurfaceView surfacev){
  mMp.addPlayerStateListener(this,new YTPlayer.PlayerStateListener(){
    @Override public void onStateChanged(    YTPlayer.MPState from,    int fromFlag,    YTPlayer.MPState to,    int toFlag){
      pvConfigureAll(mPlayerv,mPlayerLDrawer,from,fromFlag,to,toFlag);
      notiConfigure(from,fromFlag,to,toFlag);
    }
    @Override public void onBufferingChanged(    int percent){
      mUpdateProg.updateSecondary(percent);
    }
  }
);
  ViewGroup progv=(ViewGroup)playerv.findViewById(R.id.mplayer_progress);
  SeekBar sb=(SeekBar)progv.findViewById(R.id.mplayer_seekbar);
  sb.setMax(SEEKBAR_MAX);
  sb.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
      mMp.playerSeekTo((int)(seekBar.getProgress() * (long)mMp.playerGetDuration() / SEEKBAR_MAX));
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
    }
  }
);
  mUpdateProg.setProgressView(progv);
  if (null != playerLDrawer) {
    ListView lv=(ListView)playerLDrawer.findViewById(R.id.mplayer_list);
    lv.setOnItemClickListener(new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> parent,      View view,      int position,      long id){
        if (!mMp.hasActiveVideo())         return;
        mMp.startVideoAt(position);
      }
    }
);
    mMp.addVideosStateListener(this,new YTPlayer.VideosStateListener(){
      @Override public void onStopped(      YTPlayer.StopState state){
        boolean needToNotification=true;
        CharSequence msg="String_Node_Str";
switch (state) {
case DONE:
          needToNotification=false;
        msg=mRes.getText(R.string.msg_playing_done);
      break;
case FORCE_STOPPED:
    needToNotification=false;
  msg=mRes.getText(R.string.msg_playing_stopped);
break;
case NETWORK_UNAVAILABLE:
msg=mRes.getText(R.string.err_network_unavailable);
break;
case UNKNOWN_ERROR:
msg=mRes.getText(R.string.msg_playing_err_unknown);
break;
}
if (null != mPlayerv) {
TextView titlev=(TextView)mPlayerv.findViewById(R.id.mplayer_title);
pvSetTitle(titlev,mRes.getText(R.string.msg_playing_done));
}
if (needToNotification) NotiManager.get().putPlayerNotification(NotiManager.NotiType.ALERT,(String)msg);
}
@Override public void onStarted(){
if (null != mPlayerv) pvEnableLDrawer(mPlayerLDrawer);
}
@Override public void onChanged(){
if (null != mPlayerv) pvConfigureControl((ViewGroup)mPlayerv.findViewById(R.id.mplayer_control),YTPlayer.MPState.INVALID,YTPlayer.MPSTATE_FLAG_IDLE,mMp.playerGetState(),mMp.playerGetStateFlag());
if (null == mPlayerLDrawer) return;
if (mMp.hasActiveVideo()) {
ListView lv=(ListView)mPlayerLDrawer.findViewById(R.id.mplayer_list);
YTPlayerVideoListAdapter adapter=(YTPlayerVideoListAdapter)lv.getAdapter();
if (null != adapter) adapter.setVidArray(mMp.getVideoList());
}
 else pvDisableLDrawer(mPlayerLDrawer);
}
}
);
final SlidingDrawer drawer=(SlidingDrawer)playerLDrawer.findViewById(R.id.mplayer_ldrawer);
drawer.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener(){
@Override public void onDrawerOpened(){
if (!mMp.hasActiveVideo() || null == mPlayerLDrawer) return;
ListView lv=(ListView)mPlayerLDrawer.findViewById(R.id.mplayer_list);
int topPos=mMp.getActiveVideoIndex() - 1;
if (topPos < 0) topPos=0;
lv.setSelectionFromTop(topPos,0);
}
}
);
}
pvEnableLDrawer(playerLDrawer);
pvSetupStatusBar(playerv);
pvSetupControlButton(playerv);
mUpdateProg.update(mMp.playerGetDuration(),mMp.playerGetPosition());
pvConfigureAll(playerv,playerLDrawer,YTPlayer.MPState.INVALID,YTPlayer.MPSTATE_FLAG_IDLE,mMp.playerGetState(),mMp.playerGetStateFlag());
}