summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-03-21 01:32:31 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-03-21 01:32:31 +0100
commit3aeeed49a9f3c18fa59dedd15100711c68552c9d (patch)
treec0db8e0a7cd0ae7d15b648ace23ceb8cc4d9896f /src/timeline/InputBar.cpp
parentThumbnail video (diff)
downloadnheko-3aeeed49a9f3c18fa59dedd15100711c68552c9d.tar.xz
Also stop audio player
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 61c807cf..a2228541 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -850,11 +850,15 @@ MediaUpload::MediaUpload(std::unique_ptr<QIODevice> source_,
                     }
                 });
         connect(mediaPlayer, &QMediaPlayer::durationChanged, [this, mediaPlayer](qint64 duration) {
-            if (duration > 0)
+            if (duration > 0) {
                 this->duration_ = mediaPlayer->duration();
+                if (mimeClass_ == u"audio")
+                    mediaPlayer->stop();
+            }
             nhlog::ui()->debug("Duration changed {}", duration);
         });
         mediaPlayer->setMedia(QMediaContent(originalFilename_), source.get());
+
         mediaPlayer->play();
     }
 }