love icon indicating copy to clipboard operation
love copied to clipboard

Video playback freezes after resume on iOS

Open slime73 opened this issue 6 years ago • 6 comments

Original report by Evan Barger (Bitbucket: epbarger, GitHub: epbarger).


  • Play a video within your love app
  • Suspend the app by going to the home screen, or opening another app.
  • Resume the love app. The video will be frozen. video:isPlaying() will return true, but the video won't move. Video:tell() will return a value longer than the video length. Rewinding and toggling pause/play doesn't seem to change anything.

slime73 avatar Aug 25 '18 16:08 slime73

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


You mention tell returns a value past the end of the video. Does seeking change that value at all? If you can attach a debugger, or anyone else can, is the video decoding thread still running and in an endless loop, or has it stopped altogether?

Oh, and another thought, does this happen when the video has audio, has no audio, or in both cases?

slime73 avatar Aug 28 '18 19:08 slime73

Original comment by Sasha Szpakowski (Bitbucket: slime73, GitHub: slime73).


I did a bit of testing and this seems to only happen with theora videos that don't have audio. It looks like it's looping infinitely inside OggDemuxer::readPage (ogg_sync_pageout is never returning 1 I guess), and the call stack has it inside the seekDecoder call caused by the lag counter logic.

slime73 avatar May 18 '19 00:05 slime73

Original comment by Sasha Szpakowski (Bitbucket: slime73, GitHub: slime73).


It’s possible this is the same issue as part of #1401.

slime73 avatar May 18 '19 01:05 slime73

Original comment by Evan Barger (Bitbucket: epbarger, GitHub: epbarger).


For the record, I believe I was using a theora video with no audio when I opened this original ticket.

slime73 avatar May 18 '19 13:05 slime73

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


Given the location of the loop as reported by slime, it probably isn’t fixed, but can you check if it still happens after commit 753ffd906b04f548a6323ea1c36bdfc16fa18e89?

slime73 avatar May 22 '19 18:05 slime73

Original comment by Sasha Szpakowski (Bitbucket: slime73, GitHub: slime73).


As of that commit it no longer freezes, but it does seem to keep playing in the background for a while. The test video I’m using is pretty short so it often just ends up completing by the time love is in the foreground again.

I suppose something like our code to pause Sources when backgrounding on Android might be necessary.

slime73 avatar May 25 '19 11:05 slime73