mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add some assertions and logging for a crash debugging.
This commit is contained in:
parent
28fe98af80
commit
4ff9e90153
1 changed files with 16 additions and 1 deletions
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ffmpeg/ffmpeg_utility.h"
|
#include "ffmpeg/ffmpeg_utility.h"
|
||||||
#include "media/audio/media_audio.h"
|
#include "media/audio/media_audio.h"
|
||||||
#include "base/concurrent_timer.h"
|
#include "base/concurrent_timer.h"
|
||||||
|
#include "core/crash_reports.h"
|
||||||
|
|
||||||
namespace Media {
|
namespace Media {
|
||||||
namespace Streaming {
|
namespace Streaming {
|
||||||
|
@ -288,6 +289,7 @@ void VideoTrackObject::readFrames() {
|
||||||
}
|
}
|
||||||
}, [&](Shared::PrepareNextCheck delay) {
|
}, [&](Shared::PrepareNextCheck delay) {
|
||||||
Expects(delay == kTimeUnknown || delay > 0);
|
Expects(delay == kTimeUnknown || delay > 0);
|
||||||
|
|
||||||
if (delay != kTimeUnknown) {
|
if (delay != kTimeUnknown) {
|
||||||
queueReadFrames(delay);
|
queueReadFrames(delay);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +305,8 @@ auto VideoTrackObject::readEnoughFrames(crl::time trackTime)
|
||||||
-> ReadEnoughState {
|
-> ReadEnoughState {
|
||||||
const auto dropStaleFrames = !_options.waitForMarkAsShown;
|
const auto dropStaleFrames = !_options.waitForMarkAsShown;
|
||||||
const auto state = _shared->prepareState(trackTime, dropStaleFrames);
|
const auto state = _shared->prepareState(trackTime, dropStaleFrames);
|
||||||
return v::match(state, [&](Shared::PrepareFrame frame) -> ReadEnoughState {
|
return v::match(state, [&](Shared::PrepareFrame frame)
|
||||||
|
-> ReadEnoughState {
|
||||||
while (true) {
|
while (true) {
|
||||||
const auto result = readFrame(frame);
|
const auto result = readFrame(frame);
|
||||||
if (result != FrameResult::Done) {
|
if (result != FrameResult::Done) {
|
||||||
|
@ -314,6 +317,8 @@ auto VideoTrackObject::readEnoughFrames(crl::time trackTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [&](Shared::PrepareNextCheck delay) -> ReadEnoughState {
|
}, [&](Shared::PrepareNextCheck delay) -> ReadEnoughState {
|
||||||
|
Expects(delay == kTimeUnknown || delay > 0); // Debugging crash.
|
||||||
|
|
||||||
return delay;
|
return delay;
|
||||||
}, [&](v::null_t) -> ReadEnoughState {
|
}, [&](v::null_t) -> ReadEnoughState {
|
||||||
return FrameResult::Done;
|
return FrameResult::Done;
|
||||||
|
@ -752,6 +757,16 @@ auto VideoTrack::Shared::prepareState(
|
||||||
next->displayed = kDisplaySkipped;
|
next->displayed = kDisplaySkipped;
|
||||||
return next;
|
return next;
|
||||||
} else {
|
} else {
|
||||||
|
if (frame->position - trackTime + 1 <= 0) { // Debugging crash.
|
||||||
|
CrashReports::SetAnnotation(
|
||||||
|
"DelayValues",
|
||||||
|
(QString::number(frame->position)
|
||||||
|
+ " + 1 <= "
|
||||||
|
+ QString::number(trackTime)));
|
||||||
|
}
|
||||||
|
Assert(frame->position >= trackTime);
|
||||||
|
Assert(frame->position - trackTime + 1 > 0);
|
||||||
|
|
||||||
return PrepareNextCheck(frame->position - trackTime + 1);
|
return PrepareNextCheck(frame->position - trackTime + 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue