[Qt-interest] Phonon problems using MediaObject created with QIODevice

Darryl Hunter darryl.hunter at codersoft.com.au
Sat Mar 19 02:36:36 CET 2011


Hi all,

 

I raised this bug back in December 09
(http://bugreports.qt.nokia.com/browse/QTBUG-6933) which was a problem I was
having on Windows.  Things seem to be OK now, but I'm having a similar
problem on the Mac!

 

So, Qt 4.7.1, I'm trying to play a divx movie using the mediaplayer demo.
The movie is 1.6gb in size.

 

If I play it using the qmediaplayer demo out of the box, all is OK.

 

But if I change MediaPlayer::setFile (const QString &filename) from:

m_MediaObject.setCurrentSource (Phonon::MediaSource (filename));

 

to

m_MediaObject.setCurrentSource (Phonon::MediaSource (new QFile (filename)));

 

it fails.  Ignoring the memory leak this will introduce (as I'll ultimately
manage things a bit differently), has anybody else experienced anything
similar?

 

>From what I can tell (using top), it looks like this approach attempts to
load the entire movie into memory, and the crash occurs when the program
reaches the RAM limit (as expected).

 

On Windows this isn't a problem.  The file responds almost as soon as I tell
it to start playing.  The Mac, however, is slow for all files (as I presume
it's loading them in to RAM), but if they are too big I get this crash.

 

I have actually extended QFile to do some "clever" stuff (encryption) so I
do need to use the QIODevice version of MediaSource.

 

Any help would be greatly appreciated.

 

Darryl

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110319/31def194/attachment.html 


More information about the Qt-interest-old mailing list