QMediaPlayer memory leak on QT5 (i.mx6S)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QMediaPlayer memory leak on QT5 (i.mx6S)

2,081 Views
alessandrobenfe
Contributor I

Hi,

when I use QMediaplayer to play a wav file in sequence, the use of memory increases and is never released.

The suspicious method seems to be QMediaPlayer :: setMedia, in fact if I do not use the play method, the use of memory increases.

This is my example code:
QMediaPlayer *m_player=new QMediaPlayer;
while(1)
{       
      m_player->setMedia(QUrl::fromLocalFile(path_of_file));
      m_player->play();
      sleep(2);
 }

My configuration:
- imx6solo
- Yocto
- QT 5.3.2 and QtMultimedia 5.0
- Backend: gstreamer

 

Do you know if QmediaPlayer or QtMultimedia has some kind of memory leak in the indicated version? Is there a patch for this problem, or a kind of workaround?

Thanks,
Alessandro

0 Kudos
4 Replies

1,451 Views
alessandrobenfe
Contributor I
Infinite playback of the same file was just one example, the file may change during playback; however, even using the playlist function of QMediaPlayer the problem remains.
Following code does not remove the problem:
while(1)
{
      QMediaPlayer *m_player=new QMediaPlayer;       
      m_player->setMedia(QUrl::fromLocalFile(path_of_file));
      m_player->play();
      m_player->stop();
      sleep(2);
      m_player->delete();
 }
What do you mean by "de-init" player?
I think the QMediaPlayer :: setMedia method allocates resources when it reads the file through the "backend" but does not deallocate it correctly when changing the file or destroying the player.
0 Kudos

1,451 Views
alessandrobenfe
Contributor I

I use the FSL Community BSP 1.7 (codename Dizzy).

This is my Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "i686-linux"
NATIVELSBSTRING = "Ubuntu-12.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "icorem6solo"
DISTRO = "poky"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "arm armv7a vfp neon callconvention-hard cortexa9"
TARGET_FPU = "vfp-neon"
meta
meta-yocto
meta-oe
meta-fsl-arm
meta-fsl-arm-extra
meta-fsl-demos = "<unknown>:<unknown>"
meta-qt5 = "dizzy:adeca0db212d61a933d7952ad44ea1064cfca747"
meta-ruby
meta-networking
meta-python = "<unknown>:<unknown>"

0 Kudos

1,451 Views
art
NXP Employee
NXP Employee

Seems that you have either to use some loop option to infinitely loopback the file or stop playing and de-init the player before starting playing again in the infinite loop.

0 Kudos

1,451 Views
art
NXP Employee
NXP Employee

What exactly version of the Linux BSP do you use? Please specify.

0 Kudos