Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer - memory leak?
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer - memory leak?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.0k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    Gibol
    wrote on last edited by
    #1

    Hello,
    I think I've found a memory leak caused by QMediaPlayer.

    QMediaPlayer::setMedia() increases memory usage, every time its used.
    Deleting player and video output is not releasing memory.

    Example code :
    @
    void MainWindow::play()
    {
    player = new QMediaPlayer;
    surface = new Surface; //implementation of QAbstractVideoSurface
    player->setVideoOutput(surface);
    player->setMedia((QUrl(QString("C:/file.avi")));
    player->setVolume(50);
    player->play();
    }

    void MainWindow::stop()
    {
    player->stop();
    delete player;
    delete surface;
    }
    @
    invoking play() - > stop() -> play() ... causes increase in memory usage.

    Surface is not the issue QVideoWidged used as video output causes even more memory to be wasted.
    Tested on 5.1.0 MSVC2012 64bit OpenGl
    and 5.2.0 MSVC2012 64bit ANGLE

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome to the Qt Dev Net!

      Another user found a multimedia memory leak on Windows: http://qt-project.org/forums/viewthread/38025/

      Could you please report this to https://bugreports.qt-project.org/ and post the link here?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gibol
        wrote on last edited by
        #3

        https://bugreports.qt-project.org/browse/QTBUG-36671

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          Thank you for your time :)

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved