title: Why would HLS stream distort in Stagefright 1.2 when ts files change?
body: <p>I've set up <code>Apache 2.0</code> with several <code>.m3u8</code> files serving a set of <code>mpeg2ts</code> files over <code>HLS</code>.  These <code>ts</code> files were produced with <code>libavformat</code> by <code>transmuxing</code> an <code>MP4</code> I downloaded from <code>youtube</code>.  When I play the resulting <code>HLS</code> on <code>VLC</code> or <code>QT</code>, everything works fine.  But on Android (Stagefright 1.2) the video has several problems:</p>
  
  <ol>
  <li>The option to go full-screen does not work</li>
  <li>The video duration says 1:40 when it is actually 2:00</li>
  <li>The video sometimes fails to start and you have to reload page</li>
  <li>The video reliably distorts (tears and pixelates) at transition points when switching the underlying <code>.ts</code> streams.</li>
  </ol>
  
  <p>Some of this is ameliorated if I don't use <code>HTML5</code>'s  tag.  But problem #4 remains.</p>
  
  <p>I can play other <code>m3u8</code>'s on Stagefright without any of the above problems, so I am assuming my transmuxing code is wrong, but even forgoing it and using the (recently added) <code>HLS</code> segmenting features of <code>ffmpeg</code> I have the same problem. Recoding with <code>libx264</code> changes nothing.</p>
  
  <p>I am at wit's end debugging this.</p>