2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

fixed double play of audio after download complete

This commit is contained in:
John Preston
2015-07-13 20:56:44 +03:00
parent 5595570dfe
commit 4f7f569ddd
2 changed files with 33 additions and 2 deletions

View File

@@ -1575,6 +1575,7 @@ void MainWidget::audioLoadRetry() {
}
void MainWidget::documentLoadProgress(mtpFileLoader *loader) {
bool songPlayActivated = false;
DocumentData *document = App::document(loader->objId());
if (document->loader) {
if (document->loader->done()) {
@@ -1595,6 +1596,8 @@ void MainWidget::documentLoadProgress(mtpFileLoader *loader) {
audioPlayer()->play(song);
if (App::main()) App::main()->documentPlayProgress(song);
}
songPlayActivated = true;
} else if(document->openOnSave > 0 && document->size < MediaViewImageSizeLimit) {
QImageReader reader(already);
if (reader.canRead()) {
@@ -1628,7 +1631,7 @@ void MainWidget::documentLoadProgress(mtpFileLoader *loader) {
}
App::wnd()->documentUpdated(document);
if (audioPlayer()) {
if (!songPlayActivated && audioPlayer()) {
SongMsgId playing;
AudioPlayerState playingState = AudioPlayerStopped;
int64 playingPosition = 0, playingDuration = 0;