title: Decoder init failed: OMX.qcom.video.decoder.avc,
body: <p>When I open video More then 2 time  it will give error when i open video less then 2 time it will work properly</p>
  
  <p>i can not find any solution so if you have any solution please help me out</p>
  
  <pre><code>com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(1, null, null, video/avc, null, -1, null, [480, 270, -1.0], [-1, -1])
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:479)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.reinitializeCodec(MediaCodecRenderer.java:1261)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1111)
          at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:552)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:647)
          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:536)
          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:303)
          at android.os.Handler.dispatchMessage(Handler.java:101)
          at android.os.Looper.loop(Looper.java:166)
          at android.os.HandlerThread.run(HandlerThread.java:65)
       Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(1, null, null, video/avc, null, -1, null, [480, 270, -1.0], [-1, -1])
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodecWithFallback(MediaCodecRenderer.java:753)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:474)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.reinitializeCodec(MediaCodecRenderer.java:1261) 
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1111) 
          at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:552) 
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:647) 
          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:536) 
          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:303) 
          at android.os.Handler.dispatchMessage(Handler.java:101) 
          at android.os.Looper.loop(Looper.java:166) 
          at android.os.HandlerThread.run(HandlerThread.java:65) 
       Caused by: android.media.MediaCodec$CodecException: Failed to initialize OMX.qcom.video.decoder.avc, error 0xfffffff4
          at android.media.MediaCodec.native_setup(Native Method)
          at android.media.MediaCodec.&lt;init&gt;(MediaCodec.java:1786)
          at android.media.MediaCodec.createByCodecName(MediaCodec.java:1767)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:802)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodecWithFallback(MediaCodecRenderer.java:745)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:474) 
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.reinitializeCodec(MediaCodecRenderer.java:1261) 
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1111) 
          at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:552) 
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:647) 
          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:536) 
          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:303) 
          at android.os.Handler.dispatchMessage(Handler.java:101) 
          at android.os.Looper.loop(Looper.java:166) 
          at android.os.HandlerThread.run(HandlerThread.java:65) 
  </code></pre>
  
  <p>here is exoplayer,minSdkVersion and targetSdkVersion version</p>
  
  <pre><code> implementation 'com.google.android.exoplayer:exoplayer:2.9.1'
   minSdkVersion 16
   targetSdkVersion 28
  </code></pre>
  
  <p>Here is My video play code:</p>
  
  <pre><code>view = inflater.inflate(R.layout.video_item, container, false);
                  simpleExoPlayerView = view.findViewById(R.id.video_view);
                  simpleExoPlayerView.setTag("view" + position);
                  player = ExoPlayerFactory.newSimpleInstance(context, new DefaultTrackSelector(), new DefaultLoadControl());
                  Uri mediaUri = Uri.parse(urlList.get(position));
                  mediaSource = new ExtractorMediaSource.Factory(
                          new DefaultHttpDataSourceFactory("media-slider-view")).
                          createMediaSource(mediaUri);
                  simpleExoPlayerView.setPlayer(player);
                  player.prepare(mediaSource, true, true);
                  player.setPlayWhenReady(false);
                  player.seekTo(0, 0);
  </code></pre>