mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add some assertions for a strange crash debugging.
This commit is contained in:
parent
5eba65aaa0
commit
28fe98af80
1 changed files with 33 additions and 0 deletions
|
@ -1009,6 +1009,9 @@ void Pip::handleMousePress(QPoint position, Qt::MouseButton button) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pip::handleMouseRelease(QPoint position, Qt::MouseButton button) {
|
void Pip::handleMouseRelease(QPoint position, Qt::MouseButton button) {
|
||||||
|
Expects(1 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
const auto weak = Ui::MakeWeak(_panel.widget());
|
const auto weak = Ui::MakeWeak(_panel.widget());
|
||||||
const auto guard = gsl::finally([&] {
|
const auto guard = gsl::finally([&] {
|
||||||
if (weak) {
|
if (weak) {
|
||||||
|
@ -1019,10 +1022,22 @@ void Pip::handleMouseRelease(QPoint position, Qt::MouseButton button) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
seekUpdate(position);
|
seekUpdate(position);
|
||||||
|
|
||||||
|
Assert(2 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
volumeControllerUpdate(position);
|
volumeControllerUpdate(position);
|
||||||
|
|
||||||
|
Assert(3 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
const auto pressed = base::take(_pressed);
|
const auto pressed = base::take(_pressed);
|
||||||
if (pressed && *pressed == OverState::Playback) {
|
if (pressed && *pressed == OverState::Playback) {
|
||||||
_panel.setDragDisabled(false);
|
_panel.setDragDisabled(false);
|
||||||
|
|
||||||
|
Assert(4 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
seekFinish(_playbackProgress->value());
|
seekFinish(_playbackProgress->value());
|
||||||
} else if (pressed && *pressed == OverState::VolumeController) {
|
} else if (pressed && *pressed == OverState::VolumeController) {
|
||||||
_panel.setDragDisabled(false);
|
_panel.setDragDisabled(false);
|
||||||
|
@ -1083,6 +1098,9 @@ void Pip::seekProgress(float64 value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pip::seekFinish(float64 value) {
|
void Pip::seekFinish(float64 value) {
|
||||||
|
Expects(5 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
if (!_lastDurationMs) {
|
if (!_lastDurationMs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1556,15 +1574,30 @@ void Pip::playbackPauseResume() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pip::restartAtSeekPosition(crl::time position) {
|
void Pip::restartAtSeekPosition(crl::time position) {
|
||||||
|
Expects(6 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
if (!_instance.info().video.cover.isNull()) {
|
if (!_instance.info().video.cover.isNull()) {
|
||||||
_preparedCoverStorage = QImage();
|
_preparedCoverStorage = QImage();
|
||||||
_preparedCoverState = ThumbState::Empty;
|
_preparedCoverState = ThumbState::Empty;
|
||||||
_instance.saveFrameToCover();
|
_instance.saveFrameToCover();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Assert(7 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
auto options = Streaming::PlaybackOptions();
|
auto options = Streaming::PlaybackOptions();
|
||||||
options.position = position;
|
options.position = position;
|
||||||
options.audioId = _instance.player().prepareLegacyState().id;
|
options.audioId = _instance.player().prepareLegacyState().id;
|
||||||
|
|
||||||
|
Assert(8 && _delegate->pipPlaybackSpeed() >= 0.5
|
||||||
|
&& _delegate->pipPlaybackSpeed() <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
options.speed = _delegate->pipPlaybackSpeed();
|
options.speed = _delegate->pipPlaybackSpeed();
|
||||||
|
|
||||||
|
Assert(9 && options.speed >= 0.5
|
||||||
|
&& options.speed <= 2.); // Debugging strange crash.
|
||||||
|
|
||||||
_instance.play(options);
|
_instance.play(options);
|
||||||
if (_startPaused) {
|
if (_startPaused) {
|
||||||
_instance.pause();
|
_instance.pause();
|
||||||
|
|
Loading…
Add table
Reference in a new issue