Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Phonon os x - when using QIoDevice it appears the entire file is read into memory when setcurrentsource is called

    General and Desktop
    1
    2
    1427
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jolson last edited by

      I have an application that has been running on windows for a while now, we recently started testing it on mac.
      We are using phonon to play video, for some reason when we call setcurrentsouce it appears to load the entire file into memory.
      With smaller files we are able to successfully play the video after a short delay. The problem is large files (2GB) cause a crash when the computer runs out of memory.

      If I change the input from a QFile to a QString path to the file the playback works as expected. -I cannot use a path or url for a solution I need QIODevice to work as we need to do some preprocessing on the file.

      This only happens on Mac on windows it works as expected.

      Anyone have a similar issue/or have a solution?

      Below is the code
      QFile *file = new QFile("/Users/.../D 2.mp4");
      media->setCurrentSource(file); //If I use the path instead everything works, using QFile the entire file is loaded into memory.

      1 Reply Last reply Reply Quote 0
      • J
        jolson last edited by

        I figured this out. This is as designed. Its not an issue with QT but really quicktime. Quick time will load the entire file into memory unless you pass it a file name

        1 Reply Last reply Reply Quote 0
        • First post
          Last post