Disconnect probe control in case source was destroyed.
Change-Id: Ibc4583af8acf7d28ee2504f246840a26e3a527be Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> Reviewed-by: Mithra Pattison <mithra.pattison@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
c9749cf7ac
commit
f1c4093f37
@@ -125,6 +125,14 @@ bool QAudioProbe::setSource(QMediaObject *source)
|
|||||||
// 1) disconnect from current source if necessary
|
// 1) disconnect from current source if necessary
|
||||||
// 2) see if new one has the probe control
|
// 2) see if new one has the probe control
|
||||||
// 3) connect if so
|
// 3) connect if so
|
||||||
|
|
||||||
|
// in case source was destroyed but probe control is still valid
|
||||||
|
if (!d->source && d->probee) {
|
||||||
|
disconnect(d->probee.data(), SIGNAL(audioBufferProbed(QAudioBuffer)), this, SIGNAL(audioBufferProbed(QAudioBuffer)));
|
||||||
|
disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
|
||||||
|
d->probee.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (source != d->source.data()) {
|
if (source != d->source.data()) {
|
||||||
if (d->source) {
|
if (d->source) {
|
||||||
Q_ASSERT(d->probee);
|
Q_ASSERT(d->probee);
|
||||||
|
|||||||
@@ -130,6 +130,14 @@ bool QVideoProbe::setSource(QMediaObject *source)
|
|||||||
// 1) disconnect from current source if necessary
|
// 1) disconnect from current source if necessary
|
||||||
// 2) see if new one has the probe control
|
// 2) see if new one has the probe control
|
||||||
// 3) connect if so
|
// 3) connect if so
|
||||||
|
|
||||||
|
// in case source was destroyed but probe control is still valid
|
||||||
|
if (!d->source && d->probee) {
|
||||||
|
disconnect(d->probee.data(), SIGNAL(videoFrameProbed(QVideoFrame)), this, SIGNAL(videoFrameProbed(QVideoFrame)));
|
||||||
|
disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
|
||||||
|
d->probee.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (source != d->source.data()) {
|
if (source != d->source.data()) {
|
||||||
if (d->source) {
|
if (d->source) {
|
||||||
Q_ASSERT(d->probee);
|
Q_ASSERT(d->probee);
|
||||||
|
|||||||
Reference in New Issue
Block a user