Program: 110089
Project: 110089
Buggy source:
private void pvSetupControlButton(final ViewGroup playerv){
  ImageView btn=(ImageView)playerv.findViewById(R.id.mplayer_btnplay);
  btn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      YTPlayer.MPState nextst=(YTPlayer.MPState)v.getTag();
      if (null == nextst)       return;
switch (nextst) {
case STARTED:
        mMp.playerStart();
      break;
case PAUSED:
    mMp.playerPause();
  break;
case STOPPED:
mMp.stopVideos();
break;
default :
;
}
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnprev);
btn.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
mMp.startPrevVideo();
pvDisableControlButton(playerv);
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnnext);
btn.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
mMp.startNextVideo();
pvDisableControlButton(playerv);
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnvol);
btn.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
if (!mMp.hasActiveVideo()) return;
changeVideoVolume(mMp.getActiveVideo().title,mMp.getActiveVideo().videoId);
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnextra);
View.OnClickListener onClick;
if (null == mCustomExtraBtn) {
btn.setImageResource(R.drawable.ic_media_video);
onClick=new View.OnClickListener(){
@Override public void onClick(View v){
if (!mMp.hasActiveVideo() || null == mVActivity) return;
mMp.prepareTransitionMPMode();
mVActivity.startActivity(new Intent(mVActivity,VideoPlayerActivity.class));
}
}
;
}
 else {
btn.setImageResource(mCustomExtraBtn.mDrawable);
onClick=mCustomExtraBtn.mExtraBtnClick;
}
btn.setOnClickListener(onClick);
if (null != mSurfacev) btn.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void pvSetupControlButton(final ViewGroup playerv){
  ImageView btn=(ImageView)playerv.findViewById(R.id.mplayer_btnplay);
  btn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      YTPlayer.MPState nextst=(YTPlayer.MPState)v.getTag();
      if (null == nextst)       return;
switch (nextst) {
case STARTED:
        mMp.playerStart();
      break;
case PAUSED:
    mMp.playerPause();
  break;
case STOPPED:
mMp.stopVideos();
break;
default :
;
}
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnprev);
btn.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
mMp.startPrevVideo();
pvDisableControlButton(playerv);
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnnext);
btn.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
mMp.startNextVideo();
pvDisableControlButton(playerv);
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnvol);
btn.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
if (!mMp.hasActiveVideo()) return;
changeVideoVolume(mMp.getActiveVideo().title,mMp.getActiveVideo().videoId);
}
}
);
btn=(ImageView)playerv.findViewById(R.id.mplayer_btnextra);
View.OnClickListener onClick;
if (null == mCustomExtraBtn) {
btn.setImageResource(R.drawable.ic_media_video);
onClick=new View.OnClickListener(){
@Override public void onClick(View v){
if (!mMp.hasActiveVideo() || null == mVActivity) return;
mMp.backupPlayerState();
mVActivity.startActivity(new Intent(mVActivity,VideoPlayerActivity.class));
}
}
;
}
 else {
btn.setImageResource(mCustomExtraBtn.mDrawable);
onClick=mCustomExtraBtn.mExtraBtnClick;
}
btn.setOnClickListener(onClick);
if (null != mSurfacev) btn.setVisibility(View.GONE);
}