Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62789

QAudioDecoder memory leak

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.3
    • 5.8.0
    • Multimedia
    • None
    • CentOS7.1x64 (GStreamer_1.0 is used as QAudioDecoder backend)

    Description

      I have found that this custom function produce memory leak:

      void readSoundRecord(const QString &_fileName, QAudioFormat &_format, QByteArray &_bytearray)
      { 
          QAudioDecoder audiodecoder;
      
          connect(&audiodecoder, SIGNAL(error(QAudioDecoder::Error)), this, SLOT(audioDecoderError(QAudioDecoder::Error)));
          audiodecoder.setSourceFilename(_fileName);
      
          QEventLoop _el;
          connect(&audiodecoder, SIGNAL(finished()), &_el, SLOT(quit()));
          connect(&audiodecoder, SIGNAL(error(QAudioDecoder::Error)), &_el, SLOT(quit()));
          connect(&audiodecoder, &QAudioDecoder::bufferReady, [&audiodecoder, &_bytearray, &_format] () {
              QAudioBuffer _ab = audiodecoder.read();
              _format = _ab.format();
              _bytearray.append(QByteArray(_ab.constData<char>(),_ab.byteCount()));
          });
          audiodecoder.start();
          _el.exec();
      }
      
      

      this issue can be reproduced in CentOS7.1x64, in Windows all works fine (no leaks). So it seems that problem somwhere between QAudioDecoder and GStreamer_1.0.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            pi-null-mezon Alex Taranov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes