love icon indicating copy to clipboard operation
love copied to clipboard

When other applications are running, videos start to get artifacts and can lock up

Open slime73 opened this issue 6 years ago • 5 comments

Original report by Varun Ramesh (Bitbucket: varunr, GitHub: varunr).


When other applications are running (generally video players / recorders), videos in Love start to get artifacts. This is unfortunate, but what's worse is the video will permanently lock up after artifacts accumulate. video:tell() freezes at a certain value and video:isPlaying() always returns true.

When this happens, love.update and love.draw callbacks are still being called, so ui elements still work correctly. However, when the game quits, the process does not exit and must be killed.

I've attached a repro .love. I recommend running it while another video player is playing or OBS is recording.

slime73 avatar Apr 12 '18 02:04 slime73

Original comment by Varun Ramesh (Bitbucket: varunr, GitHub: varunr).


Here's a recording of what the artifacts / lockup look like.

slime73 avatar Apr 12 '18 02:04 slime73

Original comment by Varun Ramesh (Bitbucket: varunr, GitHub: varunr).


As far as I can tell, the freezing is due to an infinite loop in OggDemuxer::readPage(). ogg_sync_pageout always returns zero and file->read also always returns zero.

slime73 avatar Apr 12 '18 09:04 slime73

Original comment by Varun Ramesh (Bitbucket: varunr, GitHub: varunr).


Commenting out the lagCounter code in TheoraVideoStream::threadedFillBackBuffer seems to fix the lockup. I still get artifacts, but that's not as big of a problem. I'm thinking that the issue has to do with trying to seek past the end of the file while trying to compensate for lag.

#!c++
//		if (lagCounter++ > 5)
//		{
//			seekDecoder(position);
//			lagCounter = 0;
//		}

slime73 avatar Apr 12 '18 10:04 slime73

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


I still need to find a better way to detect when to seek forwards... I should be able to do something about EOF, though I hoped I'd had the last of the EOF issues.

slime73 avatar Apr 12 '18 15:04 slime73