Program: 110334
Project: 110334
Buggy source:
public SimpleExoPlayerView(Context context,AttributeSet attrs,int defStyleAttr){
  super(context,attrs,defStyleAttr);
  int playerLayoutId=R.layout.exo_simple_player_view;
  boolean useArtwork=true;
  boolean useController=true;
  int surfaceType=SURFACE_TYPE_SURFACE_VIEW;
  int resizeMode=AspectRatioFrameLayout.RESIZE_MODE_FIT;
  int rewindMs=PlaybackControlView.DEFAULT_REWIND_MS;
  int fastForwardMs=PlaybackControlView.DEFAULT_FAST_FORWARD_MS;
  int controllerShowTimeoutMs=PlaybackControlView.DEFAULT_SHOW_TIMEOUT_MS;
  if (attrs != null) {
    TypedArray a=context.getTheme().obtainStyledAttributes(attrs,R.styleable.SimpleExoPlayerView,0,0);
    try {
      playerLayoutId=a.getResourceId(R.styleable.SimpleExoPlayerView_player_layout_id,playerLayoutId);
      useArtwork=a.getBoolean(R.styleable.SimpleExoPlayerView_use_artwork,useArtwork);
      useController=a.getBoolean(R.styleable.SimpleExoPlayerView_use_controller,useController);
      surfaceType=a.getInt(R.styleable.SimpleExoPlayerView_surface_type,surfaceType);
      resizeMode=a.getInt(R.styleable.SimpleExoPlayerView_resize_mode,resizeMode);
      rewindMs=a.getInt(R.styleable.SimpleExoPlayerView_rewind_increment,rewindMs);
      fastForwardMs=a.getInt(R.styleable.SimpleExoPlayerView_fastforward_increment,fastForwardMs);
      controllerShowTimeoutMs=a.getInt(R.styleable.SimpleExoPlayerView_show_timeout,controllerShowTimeoutMs);
    }
  finally {
      a.recycle();
    }
  }
  LayoutInflater.from(context).inflate(playerLayoutId,this);
  componentListener=new ComponentListener();
  videoFrame=(ViewGroup)findViewById(R.id.exo_video_frame);
  if (videoFrame != null) {
    if (videoFrame instanceof AspectRatioFrameLayout) {
      aspectRatioVideoFrame=(AspectRatioFrameLayout)videoFrame;
      setResizeModeRaw(aspectRatioVideoFrame,resizeMode);
    }
 else {
      aspectRatioVideoFrame=null;
    }
    shutterView=Assertions.checkNotNull(videoFrame.findViewById(R.id.exo_shutter));
    if (surfaceType != SURFACE_TYPE_NONE) {
      ViewGroup.LayoutParams params=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
      surfaceView=surfaceType == SURFACE_TYPE_TEXTURE_VIEW ? new TextureView(context) : new SurfaceView(context);
      surfaceView.setLayoutParams(params);
      videoFrame.addView(surfaceView,0);
    }
 else {
      surfaceView=null;
    }
  }
 else {
    aspectRatioVideoFrame=null;
    shutterView=null;
    surfaceView=null;
  }
  artworkView=(ImageView)findViewById(R.id.exo_artwork);
  this.useArtwork=useArtwork && artworkView != null;
  subtitleView=(SubtitleView)findViewById(R.id.exo_subtitles);
  if (subtitleView != null) {
    subtitleView.setUserDefaultStyle();
    subtitleView.setUserDefaultTextSize();
  }
  PlaybackControlView controller=(PlaybackControlView)findViewById(R.id.exo_controller);
  if (controller != null) {
    controller.setRewindIncrementMs(rewindMs);
    controller.setFastForwardIncrementMs(fastForwardMs);
  }
 else {
    View controllerPlaceholder=findViewById(R.id.exo_controller_placeholder);
    if (controllerPlaceholder != null) {
      controller=new PlaybackControlView(context,attrs);
      controller.setLayoutParams(controllerPlaceholder.getLayoutParams());
      ViewGroup parent=((ViewGroup)controllerPlaceholder.getParent());
      int controllerIndex=parent.indexOfChild(controllerPlaceholder);
      parent.removeView(controllerPlaceholder);
      parent.addView(controller,controllerIndex);
    }
  }
  this.controller=controller;
  this.controllerShowTimeoutMs=controller != null ? controllerShowTimeoutMs : 0;
  this.useController=useController && controller != null;
  hideController();
}

Fixed version (ground truth):
public SimpleExoPlayerView(Context context,AttributeSet attrs,int defStyleAttr){
  super(context,attrs,defStyleAttr);
  int playerLayoutId=R.layout.exo_simple_player_view;
  boolean useArtwork=true;
  boolean useController=true;
  int surfaceType=SURFACE_TYPE_SURFACE_VIEW;
  int resizeMode=AspectRatioFrameLayout.RESIZE_MODE_FIT;
  int rewindMs=PlaybackControlView.DEFAULT_REWIND_MS;
  int fastForwardMs=PlaybackControlView.DEFAULT_FAST_FORWARD_MS;
  int controllerShowTimeoutMs=PlaybackControlView.DEFAULT_SHOW_TIMEOUT_MS;
  if (attrs != null) {
    TypedArray a=context.getTheme().obtainStyledAttributes(attrs,R.styleable.SimpleExoPlayerView,0,0);
    try {
      playerLayoutId=a.getResourceId(R.styleable.SimpleExoPlayerView_player_layout_id,playerLayoutId);
      useArtwork=a.getBoolean(R.styleable.SimpleExoPlayerView_use_artwork,useArtwork);
      useController=a.getBoolean(R.styleable.SimpleExoPlayerView_use_controller,useController);
      surfaceType=a.getInt(R.styleable.SimpleExoPlayerView_surface_type,surfaceType);
      resizeMode=a.getInt(R.styleable.SimpleExoPlayerView_resize_mode,resizeMode);
      rewindMs=a.getInt(R.styleable.SimpleExoPlayerView_rewind_increment,rewindMs);
      fastForwardMs=a.getInt(R.styleable.SimpleExoPlayerView_fastforward_increment,fastForwardMs);
      controllerShowTimeoutMs=a.getInt(R.styleable.SimpleExoPlayerView_show_timeout,controllerShowTimeoutMs);
    }
  finally {
      a.recycle();
    }
  }
  LayoutInflater.from(context).inflate(playerLayoutId,this);
  componentListener=new ComponentListener();
  contentFrame=(AspectRatioFrameLayout)findViewById(R.id.exo_content_frame);
  if (contentFrame != null) {
    setResizeModeRaw(contentFrame,resizeMode);
  }
  shutterView=findViewById(R.id.exo_shutter);
  if (contentFrame != null && surfaceType != SURFACE_TYPE_NONE) {
    ViewGroup.LayoutParams params=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
    surfaceView=surfaceType == SURFACE_TYPE_TEXTURE_VIEW ? new TextureView(context) : new SurfaceView(context);
    surfaceView.setLayoutParams(params);
    contentFrame.addView(surfaceView,0);
  }
 else {
    surfaceView=null;
  }
  artworkView=(ImageView)findViewById(R.id.exo_artwork);
  this.useArtwork=useArtwork && artworkView != null;
  subtitleView=(SubtitleView)findViewById(R.id.exo_subtitles);
  if (subtitleView != null) {
    subtitleView.setUserDefaultStyle();
    subtitleView.setUserDefaultTextSize();
  }
  PlaybackControlView controller=(PlaybackControlView)findViewById(R.id.exo_controller);
  if (controller != null) {
    controller.setRewindIncrementMs(rewindMs);
    controller.setFastForwardIncrementMs(fastForwardMs);
  }
 else {
    View controllerPlaceholder=findViewById(R.id.exo_controller_placeholder);
    if (controllerPlaceholder != null) {
      controller=new PlaybackControlView(context,attrs);
      controller.setLayoutParams(controllerPlaceholder.getLayoutParams());
      ViewGroup parent=((ViewGroup)controllerPlaceholder.getParent());
      int controllerIndex=parent.indexOfChild(controllerPlaceholder);
      parent.removeView(controllerPlaceholder);
      parent.addView(controller,controllerIndex);
    }
  }
  this.controller=controller;
  this.controllerShowTimeoutMs=controller != null ? controllerShowTimeoutMs : 0;
  this.useController=useController && controller != null;
  hideController();
}