title: Android MediaExtractor seek() accuracy with MP3 audio files
body: <p>I am having trouble getting reasonable accuracy on seek() with Android <code>MediaExtractor</code>.  For some files, such as <a href="http://www.archive.org/download/emma_solo_librivox/emma_01_01_austen_64kb.mp3" rel="nofollow">this one</a>, I find significant inaccuracies (about 3 seconds in this case.)  I have the following flow:</p>
  
  <ol>
  <li>call <code>setDataSource()</code> and <code>selectTrack()</code></li>
  <li>call <code>seekTo()</code></li>
  <li>call <code>play()</code></li>
  </ol>
  
  <p>In this case, it seeks to an incorrect position, but reports the correct position.  If I then seek to another position, it continues to be off by the same margin.  However, if I seek to 0, it corrects itself, and then will seek to the correct location in the file.</p>
  
  <p>Is this simply a limitation / bug in MediaExtractor?  Does anyone have a fix / workaround to get more accuracy?  I would prefer not to start playback at position 0 before seeking, but I suppose that is one option.</p>
  
  <p>Some other notes:</p>
  
  <ul>
  <li>Android MediaPlayer shows the same behavior.</li>
  <li>This happens whether I select <code>MediaExtractor.SEEK_TO_PREVIOUS_SYNC</code> or <code>SEEK_TO_CLOSEST_SYNC</code></li>
  <li>I see the same problem on KitKat and Lollipop, on the emulator and physical devices.</li>
  <li>A quick analysis of one failed file showed "Wrong number of MPEG data bytes specified in Xing header," but I got the same result for files that played fine.</li>
  </ul>