2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Stopping video sound when closing mediaview (destroying Clip::Reader).

Fixed launching video with sound while song is playing.
This commit is contained in:
John Preston
2016-07-05 20:44:22 +03:00
parent 616d08255c
commit 99b15719cf
9 changed files with 76 additions and 32 deletions

View File

@@ -222,14 +222,14 @@ bool MediaView::gifShown() const {
_gif->start(_gif->width(), _gif->height(), _gif->width(), _gif->height(), false);
const_cast<MediaView*>(this)->_current = QPixmap();
}
return _gif->state() != Media::Clip::State::Error;
return true;// _gif->state() != Media::Clip::State::Error;
}
return false;
}
void MediaView::stopGif() {
delete _gif;
_gif = 0;
_gif = nullptr;
}
void MediaView::documentUpdated(DocumentData *doc) {
@@ -506,8 +506,7 @@ void MediaView::clearData() {
_a_state.stop();
}
if (!_animOpacities.isEmpty()) _animOpacities.clear();
delete _gif;
_gif = nullptr;
stopGif();
delete _menu;
_menu = nullptr;
_history = _migrated = nullptr;