Reviewing merge request #2317: Fix for Phonon deadlock when stopping MPEG2 streams (QTBUG-8420)

Phonon 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 (src/3rdparty/phonon/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 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 / 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:

Version 1
  • Version 1
  • 0a83a6c
  • e56042f
  • Fixes a deadlock occurring with certain DirectShow filters when stopping a streamed video (QTBUG-8420).

Showing 0a83a6c-e56042f

Comments

It would be nice to submit the patch here as well: http://gitorious.org/phonon/phonon
It is best to fix that upstream.

Thanks for the suggestion. I just submitted the patch to the upstream phonon repository as well, see:

http://gitorious.org/phonon/phonon/merge_requests/4

→ State changed from New to Rejected

Thanks, closing this one then.

How/when is this going to be fixed in Phonon of Qt?

→ State changed from Rejected to Merged

merged in for Qt 4.7 after discussing this with Thierry.

Add a new comment:

Login or create an account to post a comment

How to apply this merge request to your repository