mirror of https://github.com/procxx/kepka.git
Fixed client side waveform counter infinite loop.
Backported Qt 5.6.1 crash fix in cocoa integration to Qt patch.
This commit is contained in:
parent
0291888c01
commit
d31701e906
|
@ -11300,6 +11300,34 @@ index ca92103..225d85f 100644
|
||||||
QPainter p(&m_qImage);
|
QPainter p(&m_qImage);
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Source);
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
const QVector<QRect> rects = region.rects();
|
const QVector<QRect> rects = region.rects();
|
||||||
|
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||||
|
index 6bec6b1..f14d6ee 100644
|
||||||
|
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||||
|
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||||
|
@@ -422,14 +422,20 @@ void QCocoaIntegration::updateScreens()
|
||||||
|
}
|
||||||
|
siblings << screen;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+// Patch: backport crash fix from Qt 5.6.1
|
||||||
|
+ // Set virtual siblings list. All screens in mScreens are siblings, because we ignored the
|
||||||
|
+ // mirrors. Note that some of the screens we update the siblings list for here may be deleted
|
||||||
|
+ // below, but update anyway to keep the to-be-deleted screens out of the siblings list.
|
||||||
|
+ foreach (QCocoaScreen* screen, mScreens)
|
||||||
|
+ screen->setVirtualSiblings(siblings);
|
||||||
|
+
|
||||||
|
// Now the leftovers in remainingScreens are no longer current, so we can delete them.
|
||||||
|
foreach (QCocoaScreen* screen, remainingScreens) {
|
||||||
|
mScreens.removeOne(screen);
|
||||||
|
destroyScreen(screen);
|
||||||
|
}
|
||||||
|
- // All screens in mScreens are siblings, because we ignored the mirrors.
|
||||||
|
- foreach (QCocoaScreen* screen, mScreens)
|
||||||
|
- screen->setVirtualSiblings(siblings);
|
||||||
|
}
|
||||||
|
|
||||||
|
QCocoaScreen *QCocoaIntegration::screenAtIndex(int index)
|
||||||
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
||||||
index c2d206f..0f9b512 100644
|
index c2d206f..0f9b512 100644
|
||||||
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
|
||||||
|
|
|
@ -1984,7 +1984,7 @@ public:
|
||||||
|
|
||||||
int64 samples = 0;
|
int64 samples = 0;
|
||||||
auto res = readMore(buffer, samples);
|
auto res = readMore(buffer, samples);
|
||||||
if (res == ReadResult::Error) {
|
if (res == ReadResult::Error || res == ReadResult::EndOfFile) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (buffer.isEmpty()) {
|
if (buffer.isEmpty()) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ ReaderImplementation::ReadResult FFMpegReaderImplementation::readNextFrame() {
|
||||||
if (res == AVERROR_EOF) {
|
if (res == AVERROR_EOF) {
|
||||||
clearPacketQueue();
|
clearPacketQueue();
|
||||||
if (_mode == Mode::Normal) {
|
if (_mode == Mode::Normal) {
|
||||||
return ReadResult::Eof;
|
return ReadResult::EndOfFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res = avformat_seek_file(_fmtContext, _streamId, std::numeric_limits<int64_t>::min(), 0, std::numeric_limits<int64_t>::max(), 0)) < 0) {
|
if ((res = avformat_seek_file(_fmtContext, _streamId, std::numeric_limits<int64_t>::min(), 0, std::numeric_limits<int64_t>::max(), 0)) < 0) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
enum class ReadResult {
|
enum class ReadResult {
|
||||||
Success,
|
Success,
|
||||||
Error,
|
Error,
|
||||||
Eof,
|
EndOfFile,
|
||||||
};
|
};
|
||||||
// Read frames till current frame will have presentation time > frameMs, systemMs = getms().
|
// Read frames till current frame will have presentation time > frameMs, systemMs = getms().
|
||||||
virtual ReadResult readFramesTill(int64 frameMs, uint64 systemMs) = 0;
|
virtual ReadResult readFramesTill(int64 frameMs, uint64 systemMs) = 0;
|
||||||
|
|
|
@ -55,7 +55,7 @@ ReaderImplementation::ReadResult QtGifReaderImplementation::readNextFrame() {
|
||||||
if (_reader) _frameDelay = _reader->nextImageDelay();
|
if (_reader) _frameDelay = _reader->nextImageDelay();
|
||||||
if (_framesLeft < 1) {
|
if (_framesLeft < 1) {
|
||||||
if (_mode == Mode::Normal) {
|
if (_mode == Mode::Normal) {
|
||||||
return ReadResult::Eof;
|
return ReadResult::EndOfFile;
|
||||||
} else if (!jumpToStart()) {
|
} else if (!jumpToStart()) {
|
||||||
return ReadResult::Error;
|
return ReadResult::Error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,7 +346,7 @@ public:
|
||||||
}
|
}
|
||||||
if (frame() && frame()->original.isNull()) {
|
if (frame() && frame()->original.isNull()) {
|
||||||
auto readResult = _implementation->readFramesTill(-1, ms);
|
auto readResult = _implementation->readFramesTill(-1, ms);
|
||||||
if (readResult == internal::ReaderImplementation::ReadResult::Eof && _seekPositionMs > 0) {
|
if (readResult == internal::ReaderImplementation::ReadResult::EndOfFile && _seekPositionMs > 0) {
|
||||||
// If seek was done to the end: try to read the first frame,
|
// If seek was done to the end: try to read the first frame,
|
||||||
// get the frame size and return a black frame with that size.
|
// get the frame size and return a black frame with that size.
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ public:
|
||||||
ProcessResult finishProcess(uint64 ms) {
|
ProcessResult finishProcess(uint64 ms) {
|
||||||
auto frameMs = _seekPositionMs + ms - _animationStarted;
|
auto frameMs = _seekPositionMs + ms - _animationStarted;
|
||||||
auto readResult = _implementation->readFramesTill(frameMs, ms);
|
auto readResult = _implementation->readFramesTill(frameMs, ms);
|
||||||
if (readResult == internal::ReaderImplementation::ReadResult::Eof) {
|
if (readResult == internal::ReaderImplementation::ReadResult::EndOfFile) {
|
||||||
stop();
|
stop();
|
||||||
_state = State::Finished;
|
_state = State::Finished;
|
||||||
return ProcessResult::Finished;
|
return ProcessResult::Finished;
|
||||||
|
|
Loading…
Reference in New Issue