Don't try to merge GIF animation with generated MP4 animation.

This commit is contained in:
levlam 2021-01-28 15:11:14 +03:00
parent 797aaecf2a
commit 4e710553ef

View File

@ -295,6 +295,7 @@ bool AnimationsManager::merge_animations(FileId new_id, FileId old_id, bool can_
return old_->is_changed; return old_->is_changed;
} }
bool need_merge = true;
auto new_it = animations_.find(new_id); auto new_it = animations_.find(new_id);
if (new_it == animations_.end()) { if (new_it == animations_.end()) {
auto &old = animations_[old_id]; auto &old = animations_[old_id];
@ -313,8 +314,13 @@ bool AnimationsManager::merge_animations(FileId new_id, FileId old_id, bool can_
if (old_->thumbnail != new_->thumbnail) { if (old_->thumbnail != new_->thumbnail) {
// LOG_STATUS(td_->file_manager_->merge(new_->thumbnail.file_id, old_->thumbnail.file_id)); // LOG_STATUS(td_->file_manager_->merge(new_->thumbnail.file_id, old_->thumbnail.file_id));
} }
if (old_->mime_type == "image/gif" && new_->mime_type == "video/mp4") {
need_merge = false;
}
}
if (need_merge) {
LOG_STATUS(td_->file_manager_->merge(new_id, old_id));
} }
LOG_STATUS(td_->file_manager_->merge(new_id, old_id));
if (can_delete_old) { if (can_delete_old) {
animations_.erase(old_id); animations_.erase(old_id);
} }