mirror of https://github.com/procxx/kepka.git
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) {
|
if (!data->streamed || data->streamed->clearing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data->streamed->clearing = true;
|
data->streamed->clearing = true;
|
||||||
SaveLastPlaybackPosition(
|
if (savePosition) {
|
||||||
data->current.audio(),
|
SaveLastPlaybackPosition(
|
||||||
data->streamed->instance.player().prepareLegacyState());
|
data->current.audio(),
|
||||||
|
data->streamed->instance.player().prepareLegacyState());
|
||||||
|
}
|
||||||
data->streamed->instance.stop();
|
data->streamed->instance.stop();
|
||||||
data->isPlaying = false;
|
data->isPlaying = false;
|
||||||
requestRoundVideoResize();
|
requestRoundVideoResize();
|
||||||
|
@ -414,7 +416,7 @@ void Instance::playStreamed(
|
||||||
const auto data = getData(audioId.type());
|
const auto data = getData(audioId.type());
|
||||||
Assert(data != nullptr);
|
Assert(data != nullptr);
|
||||||
|
|
||||||
clearStreamed(data);
|
clearStreamed(data, data->current.audio() != audioId.audio());
|
||||||
data->streamed = std::make_unique<Streamed>(
|
data->streamed = std::make_unique<Streamed>(
|
||||||
audioId,
|
audioId,
|
||||||
std::move(shared));
|
std::move(shared));
|
||||||
|
|
|
@ -225,7 +225,7 @@ private:
|
||||||
not_null<Data*> data,
|
not_null<Data*> data,
|
||||||
Streaming::Error &&error);
|
Streaming::Error &&error);
|
||||||
|
|
||||||
void clearStreamed(not_null<Data *> data);
|
void clearStreamed(not_null<Data*> data, bool savePosition = true);
|
||||||
void emitUpdate(AudioMsgId::Type type);
|
void emitUpdate(AudioMsgId::Type type);
|
||||||
template <typename CheckCallback>
|
template <typename CheckCallback>
|
||||||
void emitUpdate(AudioMsgId::Type type, CheckCallback check);
|
void emitUpdate(AudioMsgId::Type type, CheckCallback check);
|
||||||
|
|
Loading…
Reference in New Issue