diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp
index 0bdb387853..1feaa68525 100644
--- a/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp
+++ b/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp
@@ -339,6 +339,9 @@ void VideoTrackObject::fillRequests(not_null frame) const {
QSize VideoTrackObject::chooseOriginalResize() const {
auto chosen = QSize();
for (const auto &[_, request] : _requests) {
+ if (request.resize.isEmpty()) {
+ return QSize();
+ }
const auto byWidth = (request.resize.width() >= chosen.width());
const auto byHeight = (request.resize.height() >= chosen.height());
if (byWidth && byHeight) {
@@ -459,9 +462,6 @@ void VideoTrackObject::addTimelineDelay(crl::time delayed) {
if (!delayed) {
return;
}
- if (delayed > 1000) {
- int a = 0;
- }
_syncTimePoint.worldTime += delayed;
}
@@ -806,10 +806,6 @@ void VideoTrack::Shared::addTimelineDelay(crl::time delayed) {
}
const auto recountCurrentFrame = [&](int counter) {
_delay += delayed;
- if (delayed > 1000) {
- int a = 0;
- }
-
//const auto next = (counter + 1) % (2 * kFramesCount);
//const auto index = next / 2;
//const auto frame = getFrame(index);
@@ -976,14 +972,14 @@ QImage VideoTrack::frame(
const auto frame = _shared->frameForPaint();
const auto i = frame->prepared.find(instance);
const auto none = (i == frame->prepared.end());
- const auto preparedFor = none
+ const auto preparedFor = frame->prepared.empty()
? FrameRequest::NonStrict()
- : i->second.request;
+ : (none ? frame->prepared.begin() : i)->second.request;
const auto changed = !preparedFor.goodFor(request);
const auto useRequest = changed ? request : preparedFor;
if (changed) {
_wrapped.with([=](Implementation &unwrapped) {
- unwrapped.updateFrameRequest(instance, request);
+ unwrapped.updateFrameRequest(instance, useRequest);
});
}
if (GoodForRequest(frame->original, _streamRotation, useRequest)) {
diff --git a/Telegram/SourceFiles/storage/download_manager_mtproto.cpp b/Telegram/SourceFiles/storage/download_manager_mtproto.cpp
index 44e716a94e..e261401a8b 100644
--- a/Telegram/SourceFiles/storage/download_manager_mtproto.cpp
+++ b/Telegram/SourceFiles/storage/download_manager_mtproto.cpp
@@ -125,6 +125,7 @@ void DownloadManagerMtproto::remove(not_null task) {
const auto dcId = task->dcId();
auto &queue = _queues[dcId];
queue.remove(task);
+ checkSendNext(dcId, queue);
}
void DownloadManagerMtproto::resetGeneration() {