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