Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1453

Gstreamer plugin try use deleted stream

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 1.1.x, 1.2.0
    • 1.1.1, 1.2.0
    • Multimedia
    • None
    • Ubuntu 10.04, Qt 4.7.2, Qt Mobility snapshot 03.23.11
    • cb11eb2d68610d766e8e618a0d2304fe789bb195

    Description

      If I try make something like this, my app crash.

      1. I create QMediaPlayer, open QIODevice and playing it.

      2. Then I need change QIODevice. I wrote function to reset like this:

      void RadioModule::reset(){
      player->setMedia(QMediaContent());
      ioDevice->close();
      delete ioDevice;
      ioDevice = 0;
      }

      3. Then I wrote function to play, something like this:

      void RadioModule::play(){
      ioDevice = new myQIODevice();
      ioDevice->open(QIODevice::Read);
      player->setMedia(QMediaContent(QUrl("file:/")),ioDevice);
      player->play();
      }

      4. My app crash in line player->setMedia() in 3 step.

      I made debug and saw, that crash in:

      void QGstAppSrc::setStream(QIODevice *stream)
      {
      if (m_stream)
      disconnect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady()));
      ...
      }

      Because m_stream contains pointer to old stream, that I delete in 2 step.

      And I have question. How right reset stream?

      As I understand player->setMedia(QMediaContent()) in 2 step not clear m_stream. But, if it try clear m_stream we also will have error like this, because setMedia() is slot and it may call after delete ioDevice. May be we need add QMediaPlayer::resetStream() function or other solution.
      I see workaround. If I delete object, when get signal QMediaPlayer::mediaChanged() or QMediaPlayer::mediaStatusChanged() but as for me this is bad way.

      PS: This bug difficult to reproduce. Now I try write good example.

      Attachments

        1. 4.png
          4.png
          16 kB
        2. crash.odt
          63 kB
        3. qmediaplayerbug3.zip
          2 kB

        Activity

          People

            hawcroft Derick Hawcroft (closed Nokia identity) (Inactive)
            ssyrik Surik Sayadyan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: