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

Program Crash when trying to play a mp3 file on some system

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 5.15.3
    • Multimedia
    • windows 10
    • Windows
    • Multimedia Wk 13-14, Multimedia wk 15-16

    Description

      Im playing a mp3 file using QMediaPlayer as a background music for my program. most of times it work without any problem, but in some users system sometimes somehow it make the whole program crash without any message... I generated a dump from user system that have this problem and here is some part of it:

       

      ...
      READ_ADDRESS: 0000000000000000
      ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.
      EXCEPTION_CODE_STR: c0000005
      EXCEPTION_PARAMETER1: 0000000000000000
      EXCEPTION_PARAMETER2: 0000000000000000
      IP_ON_HEAP: 00000217f887a290
      The fault address in not in any loaded module, please check your build's rebase
      log at <releasedir>\bin\build_logs\timebuild\ntrebase.log for module which may
      contain the address if it were loaded.
      FRAME_ONE_INVALID: 1
      STACK_TEXT: 
      000000ec`27efe910 00000217`f887a290 : 000000ec`27efea10 00000000`00000000 00000217`f8879360 00000000`00000001 : SMM_MP4Demuxer+0x604c
      000000ec`27efe918 000000ec`27efea10 : 00000000`00000000 00000217`f8879360 00000000`00000001 000000ec`27efe944 : 0x00000217`f887a290
      000000ec`27efe920 00000000`00000000 : 00000217`f8879360 00000000`00000001 000000ec`27efe944 00000000`00000001 : 0x000000ec`27efea10
      
      STACK_COMMAND: ~7s; .ecxr ; kb
      SYMBOL_NAME: SMM_MP4Demuxer+604c
      MODULE_NAME: SMM_MP4Demuxer
      IMAGE_NAME: SMM_MP4Demuxer.ax
      FAILURE_BUCKET_ID: NULL_POINTER_READ_c0000005_SMM_MP4Demuxer.ax!Unknown
      OS_VERSION: 10.0.19041.1
      BUILDLAB_STR: vb_release
      OSPLATFORM_TYPE: x64
      OSNAME: Windows 10
      IMAGE_VERSION: 1.0.2010.23
      FAILURE_ID_HASH: {1f1f19f2-de50-d883-9048-8a7795f973e9}
      Followup: MachineOwner
      

       

      its says that the problem is coming from `SMM_MP4Demuxer` Module, by looking at its name I think its something that coming from `QMediaPlayer`...

      here is a minimal reproducible of my code:

      #include <QtWidgets/qapplication.h>
      #include <QWidget>
      #include <QMediaPlayer>
      #include <QMediaPlaylist>
      #include <QtWidgets/QHBoxLayout>
      #include <QToolButton>
      #include <QStyle>
      
      class Widget : public QWidget
      {
      public:
      	explicit Widget(QWidget* parent = Q_NULLPTR)
      		: background_sound(new QMediaPlayer(this))
      	{
      		setupUi();
      
      		QMediaPlaylist* playlist = new QMediaPlaylist(this);
      		playlist->addMedia(QUrl("qrc:/background_sound.mp3"));
      		playlist->setPlaybackMode(QMediaPlaylist::Loop);
      
      		background_sound->setPlaylist(playlist);
      		background_sound->setVolume(70);
      
      		connect(background_sound, &QMediaPlayer::mediaStatusChanged, this, [&](QMediaPlayer::MediaStatus status) {
      			if (background_sound->error() == QMediaPlayer::NoError) {
      				if (status == QMediaPlayer::LoadedMedia)
      					background_sound->play();
      			}
      		});
      
      		connect(button, &QToolButton::released, this, [&]() {
      			if (background_sound->state() == QMediaPlayer::PlayingState) {
      				background_sound->pause();
      				button->setIcon(style()->standardIcon(QStyle::SP_MediaStop));
      			}
      			else if (background_sound->state() == QMediaPlayer::PausedState) {
      				background_sound->play();
      				button->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
      			}
      		});
      	}
      	~Widget() = default;
      
      private:
      	QMediaPlayer* background_sound;
      	QToolButton* button;
      	void setupUi()
      	{
      		setObjectName(QStringLiteral("MainWidget"));
      		setWindowTitle(tr("Test QMediaPlayer!"));
      		resize(300, 300);
      
      		auto layout = new QHBoxLayout(this);
      		layout->setObjectName(QStringLiteral("layout"));
      
      		button = new QToolButton(this);
      		button->setObjectName(QStringLiteral("button"));
      		button->setMinimumSize(50, 50);
      		button->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); // because we are playing it at start
      		layout->addWidget(button);
      	}
      
      };
      
      int main(int argc, char* argv[])
      {
      	QApplication application(argc, argv);
      	Widget w;
      	w.show();
      	return QApplication::exec();
      }
      

       

      Attachments

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

        Activity

          People

            johanseg Jøger Hansegård
            saeid_ saeid saeidi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes