mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-25 01:36:48 +00:00
Fix jump-to-time from audio captions.
This commit is contained in:
parent
76ff9a562e
commit
6cf9157fb5
@ -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));
|
||||
|
@ -225,7 +225,7 @@ private:
|
||||
not_null<Data*> data,
|
||||
Streaming::Error &&error);
|
||||
|
||||
void clearStreamed(not_null<Data *> data);
|
||||
void clearStreamed(not_null<Data*> data, bool savePosition = true);
|
||||
void emitUpdate(AudioMsgId::Type type);
|
||||
template <typename CheckCallback>
|
||||
void emitUpdate(AudioMsgId::Type type, CheckCallback check);
|
||||
|
Loading…
Reference in New Issue
Block a user