[phonon-mplayer] mplayer hang will also hang VideoPlayer

Ben Lau xbenlau at gmail.com
Wed Aug 18 10:16:55 CEST 2010


Hi Tanguy,

Thanks for reply. hmm... The mplayer log do not help much , and I have
difficulty in making a step to reprdouce the problem. However, I have
stuided the source code , and know what was happen.

1. After passed -wid to mplayer , it will create a overlapped window
(video-out window) under window with HWND = wid using CreateWindowEx
api.

2. Although the VO window is a part of the Qt's GUI program, but Qt
know nothing about it ,and will not process the message queue of the
child window.

3. MPlayer peek message from the child window periodally, but the loop
and video/audio decoder is under the same thread. If the decoder hang
, or busy , it will not able to process the message queue (In fact, it
don't really do any processing , it just clear the queue).

4. If the message queue's item is held for long time , OS will think
that it is "not responded" . And the "not responed" application is the
Qt app , instead of mplayer.

The above problem may happen in following condition:

1. Decode a video /audio with serious corrupted frame that generate a
lot of ffmpeg error , you will find that the GUI is less responsive ,
and it is difficult to move and resize.

2. Stream a HTTP video from remote site , once it is started , unplug
your lan cable , after the video is frozen , move the window , like
condition 1, you will find that it is not responsive. (p.s mplayer
will stop after 10 sec of time out)


One of the possible solution is to let phonon to capture the message
queue on VO window , but it need to write in Win32API and it may
demand too much from phonon-mplayer .... so I am thinking about a
better solution.


On Mon, Aug 16, 2010 at 8:43 PM, Tanguy Krotoff <tkrotoff at gmail.com> wrote:
> Hi
>
> Could you provide MPlayer log, it might help to see what is going on.
> About MPlayer locking the drawing window of your application, this can
> be verified by changing method MPlayerProcess::start() and disable the
> following lines:
> args << "-wid";
> args << QString::number((qint64) _mediaData.videoWidgetId);
> inside file http://gitorious.org/phonon/phonon-mplayer/blobs/master/mplayer/libmplayer/MPlayerProcess.cpp
>
> Parameter -wid gives the window ID where MPlayer should paint the
> video. No -wid parameter no MPlayer painting :) (the video still will
> be played it just disable the video output)
>
> Keep in mind MPlayer runs inside an independant QProcess (see
> MyProcess.cpp and MPlayerProcess.cpp)
>
>
> On Sun, Aug 15, 2010 at 6:11 AM, Ben Lau <xbenlau at gmail.com> wrote:
>> Hi,
>>
>>  I have a video player that use phonon-mplayer on windows. When I
>> play a video file with partly recognized audio codec , mplayer will
>> not work correctly and finally hang. It is normal , however, if
>> mplayer hang , it will also hang my video player... The video player
>> will become "Not responded" application.  The same configuration is
>> fine in Linux , the mplayer also hang , but it won't hang the video
>> player. It may kill mplayer and let's the application to restart
>> mplayer
>>
>>  I am not familiar with windows programming , I guess the mplayer has
>> locked the drawing window for video(Hold the event loop?) And
>> Phonon::VideoPlayer is also locked on the window (acquire an event?) .
>> Is there any way to ask Phonon::VideoPlayer to provide a window for
>> mplayer that will not acquire lock or don't read any event ?
>>
>> Thanks for any advise.
>
> --
> Tanguy Krotoff <tkrotoff at gmail.com>
> +33 6 68 42 70 24
>


More information about the Phonon-backends mailing list