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

Program crash in QAudioDecoder destructor or constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.12.3, 5.12.4
    • Multimedia
    • None
    • ubuntu 18.04 (qt versions 5.12.3, 5.12.4) and in windows (qt version 5.12.3 try plugins: direct show and wmf)
    • Linux/Wayland, Windows

    Description

      I run in separate thread next code:

      QByteArray ba_buffer;
      QAudioDecoder decoder;
       //decoder.audioFormat() is empty after finished
       QAudioFormat aFormat;
       decoder.setSourceFilename(fileInfo.absoluteFilePath());
       decoder.start();
       QEventLoop loop;
       connect(&decoder, &QAudioDecoder::bufferReady,
       &loop, [&decoder, &ba_buffer, &aFormat]()
       {
       auto audio_buffer = decoder.read();
      aFormat = audio_buffer.format();
      ba_buffer.append(audio_buffer.constData<char>(), audio_buffer.byteCount());
       });
       connect(&decoder, &QAudioDecoder::finished,
       &loop, &QEventLoop::quit, Qt::QueuedConnection);
       connect(&decoder, QOverload<QAudioDecoder::Error>::of(&QAudioDecoder::error),
       &loop, [&loop](){loop.quit();}, Qt::QueuedConnection);
       QTimer timer_stop;
       connect(&timer_stop, &QTimer::timeout, &loop, [&loop, this, &timer_stop]()
       {
       if(stopLoadDir)
       {
       loop.quit();
       timer_stop.stop();
       }
       }, Qt::QueuedConnection);
       timer_stop.start(100);
      ....
       if(stopLoadDir)
       {
       return data;
       }
      

       I have many such threads. Sometimes I kill them (stopLoadDir = true, stopLoadDir is std::atomic<bool>), and create new.  And I have program crashes or in destructor QAudioDecoder or in costructor (more exactly in QPluginServiceProvider::requestService). I have such error in ubuntu 18.04 (qt versions 5.12.3, 5.12.4) and in windows (qt version 5.12.3 try plugins: direct show and wmf)

      Attachments

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

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            dvajdual Alexey Shmuley
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes