Program: 110090
Project: 110090
Buggy source:
private void pvInit(ViewGroup playerv,ViewGroup playerLDrawer,SurfaceView surfacev){
  mMp.addPlayerStateListener(this,new YTPlayer.PlayerStateListener(){
    @Override public void onStateChanged(    YTPlayer.MPState from,    YTPlayer.MPState to){
      pvConfigureAll(mPlayerv,mPlayerLDrawer,from,to);
      notiConfigure(from,to);
    }
    @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) {
    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().putNotification(NotiManager.NotiType.ALERT,(String)msg);
}
@Override public void onStarted(){
eAssert(null != mPlayerv);
pvEnableLDrawer(mPlayerLDrawer);
}
@Override public void onChanged(){
if (null != mPlayerv) pvConfigureControl((ViewGroup)mPlayerv.findViewById(R.id.mplayer_control),mMp.playerGetState(),mMp.playerGetState());
if (null == mPlayerLDrawer) return;
if (mMp.hasActiveVideo()) {
ListView lv=(ListView)mPlayerLDrawer.findViewById(R.id.mplayer_list);
YTPlayerVidArrayAdapter adapter=(YTPlayerVidArrayAdapter)lv.getAdapter();
if (null != adapter) {
adapter.setVidArray(mMp.getVideoList());
adapter.notifyDataSetChanged();
}
}
 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);
pvSetupControlButton(playerv);
pvConfigureAll(playerv,playerLDrawer,YTPlayer.MPState.INVALID,mMp.playerGetState());
}

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,    YTPlayer.MPState to){
      pvConfigureAll(mPlayerv,mPlayerLDrawer,from,to);
      notiConfigure(from,to);
    }
    @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) {
    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().putNotification(NotiManager.NotiType.ALERT,(String)msg);
}
@Override public void onStarted(){
eAssert(null != mPlayerv);
pvEnableLDrawer(mPlayerLDrawer);
}
@Override public void onChanged(){
if (null != mPlayerv) pvConfigureControl((ViewGroup)mPlayerv.findViewById(R.id.mplayer_control),mMp.playerGetState(),mMp.playerGetState());
if (null == mPlayerLDrawer) return;
if (mMp.hasActiveVideo()) {
ListView lv=(ListView)mPlayerLDrawer.findViewById(R.id.mplayer_list);
YTPlayerVidArrayAdapter adapter=(YTPlayerVidArrayAdapter)lv.getAdapter();
if (null != adapter) {
adapter.setVidArray(mMp.getVideoList());
adapter.notifyDataSetChanged();
}
}
 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);
pvSetupControlButton(playerv);
mUpdateProg.update(mMp.playerGetDuration(),mMp.playerGetPosition());
pvConfigureAll(playerv,playerLDrawer,YTPlayer.MPState.INVALID,mMp.playerGetState());
}