Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8420

Patch: Phonon deadlock when stopping MPEG2 streams

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.6.2
    • Multimedia
    • None
    • Windows 7 x64

    Description

      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.

      The problem can be reproduced by running the attached test program with the sample file sample_mpeg2.m2v in the working directory. When starting playback with the "play" button and stopping it using "stop" in the middle of the video, the application deadlocks. After applying the patch, the video stops without a deadlock.

      See the following commit for a simmilar fix in the asynchronous Request / WaitNext methods:
      http://qt.gitorious.org/+mnemis/qt/mnemogit/commit/71a8a5c97315c114d55190594a7175552bfd41a6

      [1] http://msdn.microsoft.com/en-us/library/dd376092(VS.85).aspx

      Attachments

        1. PhononHang.cpp
          1 kB
        2. qt-phonon-deadlock.patch
          1 kB
        3. sample_mpeg2.m2v
          1.28 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bachewii Jens
            mdoppler Michael Doppler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes