CrendKing / avisynth_filter

DirectShow filters that put AviSynth and VapourSynth into video playing
MIT License
108 stars 8 forks source link

PotPlayer crashes on playback stop (0.7.5+) #25

Closed chainikdn closed 3 years ago

chainikdn commented 3 years ago

... started in https://github.com/CrendKing/avisynth_filter/issues/9#issuecomment-725331263 ...

PotPlayer sometimes crashes with 0.7.5 and later, mostly when switching to another video in playlist and with LAV Video decoder in use. Last lines in the log:

T 6912 @ 33769: Frame handler start BeginFlush() T 6912 @ 33769: Frame handler cleanup after stop threads

I'm unable to attach debugger to the PotPlayer process for some reason oO so I just tried to narrow the problem down using good-old log file.

The crash occurs while waiting for output thread(s) termination in t.join();. What happens in the output thread? seems like it crashes on _filter.InitializeOutputSample()

Interesting fact:

Add a bunch videos to playlist.

It doesn't matter how many videos are in the playlist, just keep switching videos... in fact you don't need a playlist at all, you can just stop-and-play one video 10+ times. Playlist is just a quickest way to do it.

chainikdn commented 3 years ago

that one is the reason - https://github.com/CrendKing/avisynth_filter/commit/377be64ddefb74fdea2f4ae011a2be15586e9f2e

CrendKing commented 3 years ago

I managed to cause a crash after many many switches. It is the same problem why I set outSample to nullptr and added that comment. Turns out CComPtr needs a different treatment, which is simply Detach(). Setting to nullptr will cause it to Release()

Try AviSynthFilter.zip

chainikdn commented 3 years ago

yeah, that seems to work

btw, please check out these posts by mark007 about frames flickering

CrendKing commented 3 years ago

That "flickering" issue seems to be the ghost frames when using ffdshow. I've never seen any of these in avsf. Logically, because we flush all caches during seeking, old frames should never appear.

I'll need full details of how to reproduce with a separate issue. Or if you somehow also see ghost frames, tell me how to do it.

His first issue is https://github.com/CrendKing/avisynth_filter/issues/24, which sounds to be related to particular interlaced video file. I'm still waiting for his sample.