Windows Demux EOS Event Isn't Always Sent
- Dominant language
- Java
- Stars
- 287
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
When doing playback with DirectShow on Windows of live TV, when the end of the file is hit there should be an EOS event posted from the demuxer. For some reason...this is only getting sent when the user is close to live TV; but if they are about 30 seconds behind live...then the event is not getting sent at all. Here's the chain of where this comes from if somebody wants to dig into this:
Setup:
1. When the DShowTVPlayer is loaded, it will call setNotificationWindow0() which links the main HWND to the DShowEvent notifications for type WM_DVD_EVENT, in the EXE in its message loop it will get these events and then call VideoFrame.playbackControl which kicks it to get any pending events from the queue at the native layer
2. When setting up the Demux, it calls SetEventDump on the demux filter, which is a link to CPlayerData::EventDump in CPlayerData.cpp
When the EOS actually happens...what *should* occur is:
1. in native/ax/MpegDemux-3/DeMuxFilter.cpp in ReleasedSample...one of those blocks should get triggered which posts an event to m_pfnEventDump with the text starting with EndOfStream
2. in CPlayerData::EventDump it then puts the WM_DEMUX_EVENT into the event queue which should notify the main HWND that there's an event
3. the EXE sees there's a new message, and then calls VideoFrame.playbackControl
4. VideoFrame processes its queue and sees the DIRECT_CONTROL_MSG
5. DShowMediaPlayer.processEvents() is called
6, DShowMediaPlayer.processEvents0() is called, it gets the event from the IID_IMediaEvent interface which will have an event code of WM_DEMUX_EVENT and then returns 2 which sets the EOS flag in the player
My guess is that there is something wrong in DemuxFilter.cpp in ReleasedSample that is preventing it from triggering in this case.
Contributor guide
Assessment
This issue has not been assessed yet.