Browse Source

PlayerComponent: kill currently held keys when playback starts

This fixes the issue that playback sometimes starts paused. This happens
because the key is either still held down (then the keyup might toggle
pause), or because the key is autorepeated.
Vincent Lang 8 năm trước cách đây
mục cha
commit
240b52949a
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      src/player/PlayerComponent.cpp

+ 2 - 0
src/player/PlayerComponent.cpp

@@ -240,6 +240,8 @@ bool PlayerComponent::load(const QString& url, const QVariantMap& options, const
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void PlayerComponent::queueMedia(const QString& url, const QVariantMap& options, const QVariantMap &metadata, const QString& audioStream, const QString& subtitleStream)
 {
+  InputComponent::Get().cancelAutoRepeat();
+
   m_mediaFrameRate = metadata["frameRate"].toFloat(); // returns 0 on failure
   m_serverMediaInfo = metadata["media"].toMap();