2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

Fix jump-to-time from audio captions.

This commit is contained in:
John Preston
2020-02-06 13:19:33 +04:00
parent 76ff9a562e
commit 6cf9157fb5
2 changed files with 8 additions and 6 deletions

View File

@@ -189,14 +189,16 @@ void Instance::setCurrent(const AudioMsgId &audioId) {
}
}
void Instance::clearStreamed(not_null<Data*> data) {
void Instance::clearStreamed(not_null<Data*> data, bool savePosition) {
if (!data->streamed || data->streamed->clearing) {
return;
}
data->streamed->clearing = true;
SaveLastPlaybackPosition(
data->current.audio(),
data->streamed->instance.player().prepareLegacyState());
if (savePosition) {
SaveLastPlaybackPosition(
data->current.audio(),
data->streamed->instance.player().prepareLegacyState());
}
data->streamed->instance.stop();
data->isPlaying = false;
requestRoundVideoResize();
@@ -414,7 +416,7 @@ void Instance::playStreamed(
const auto data = getData(audioId.type());
Assert(data != nullptr);
clearStreamed(data);
clearStreamed(data, data->current.audio() != audioId.audio());
data->streamed = std::make_unique<Streamed>(
audioId,
std::move(shared));