title: Android Media Player set Data Source FD failed
body: <p>My code was working just fine until I increased the number of songs.
  I had 200 songs but when I put 200+ I noticed that I was receiving IOException setDataSource FD failed.</p>
  
  <p>Now after some additional tests I found that the limit before this error is 334 songs which is strange. I don't understand why it plays ok with &lt;334 and after 334 songs it crashes.</p>
  
  <p>Could you please help me?
  My code is very simple, here is the part.</p>
  
  <pre><code>ArrayList&lt;MediaPlayer&gt; mPlayerList = new ArrayList&lt;MediaPlayer&gt;();
  FileDescriptor fd = null;
      try {
  
    for (String fileName : fileList)
      {
  
              MediaPlayer mPlayerT = new MediaPlayer();
              FileInputStream fis = new FileInputStream(fileName);
              fd = fis.getFD();
              //mPlayerT.setDataSource(getApplicationContext(), myUri1);
              mPlayerT.setDataSource(fd);
              mPlayerT.prepare();
              mPlayerT.setVolume(1f, 1f);
              mPlayerT.setLooping(false);
              mPlayerList.add(mPlayerT);
      }
  
      for (int i=0; i&lt;mPlayerList.size()-1; i++) //Do not include last element
      {
          mPlayerList.get(i).setNextMediaPlayer(mPlayerList.get(i+1));
      }
  mPlayerList.get(0).start();
    } catch (IOException e) {
     e.printStackTrace();
     }
  </code></pre>
  
  <p>Just to predict your answers, the files are not either incomplete from download or corrupted. I also converted them to .ogg from .mp3 just to be sure that everything is fine. When I receive the data source failed concerning a file, if I decrease the number of songs it is working correct without removing the specific file. So, the format of the files is ok.</p>
  
  <p>Thanks in advance.</p>