Reviewing merge request #4: Fix for Phonon Direct Show deadlock when stopping MPEG2 streams (QTBUG-8420)
The Phonon Direct Show backend hangs when playing certain MPEG2 using the asynchronous streaming interface.
I tracked the problem down to the StreamReader::read() method of the Phonon Direct Show backend (ds9/iodevicereader.cpp) that is called from IAsyncReader::SyncReadAligned [1] method from the DirectShow filter decoding the video.
The problem seems to stem from the fact that the method returns beforing reading data if the graph is currently stopping. This results in some filters (e.g. the Microsoft MPEG2 decoder filter included in Windows 7) to deadlock because they wait for data infinitely after the canceled read operation.
The attached patch removes the early returns and fixes the deadlock situation.
See the bug report for a test program, a sample movie and more information:
http://bugreports.qt.nokia.com/browse/QTBUG-8420
[1] http://msdn.microsoft.com/en-us/library/dd376092(VS.85).aspx
Commits that would be merged:
- d1cf902
- 4a6f548
Fixes a deadlock occurring with certain DirectShow filters when stopping a streamed video (see QTBUG-8420 for test code and video).
d1cf902-4a6f548

Add a new comment:
Login or create an account to post a comment