Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
NULL pointer Exception in mfstream.cpp with QMediaPlayer and QTCPSocket
BERGLE last edited by
I try to implement a client for live stream video over TCP.
To display the video I tried use the QMediaPlayer class (displaying video files works well). To recieve the videostream I use the QTCPSocket class.
Connection to Server works well too. After establishing connection, the server started to stream - seems to work well too.
On the client site (my QT client) i receive the connected signal.
In the "connected" slot, I have the following code:
After "play()" I received an exception.
Debugging showed me the following:
In mfstream.cpp, the methods "BeginRead" was called - filled the member variable "m_currentReadResult".
after some other method calls, "EndRead" was called - the variable m_currentReadResult was set to NULL again.
A little bit later "bool QAbstractSocketPrivate::canReadNotification()" was called with "emit q->readyRead();"
-> void MFStream::handleReadyRead()
bool readDone = true;
IUnknown *pUnk = NULL;
HRESULT hr = m_currentReadResult->GetObject(&pUnk);
But now "m_currentReadResult is still "NULL" -> exception.
I don't know if there is a bug in the QT library or is it not recommended to use a QTcpSocket object (= QIODevice) together with
Can somebody help me?