Skip to content

Commit

Permalink
A small optimization to start playback.
Browse files Browse the repository at this point in the history
No need to seek and delay playback if already stopped, which is more
often than not.
  • Loading branch information
ddennedy committed Mar 28, 2015
1 parent 1320075 commit 50e28b8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,13 @@ void Player::onProducerOpened(bool play)
m_pauseAfterOpen = false;
QTimer::singleShot(500, this, SLOT(postProducerOpened()));
} else {
// This seek purges the consumer to prevent latent end-of-stream detection.
seek(0);
QTimer::singleShot(500, this, SLOT(play()));
if (MLT.consumer()->is_stopped()) {
this->play();
} else {
// This seek purges the consumer to prevent latent end-of-stream detection.
seek(0);
QTimer::singleShot(500, this, SLOT(play()));
}
}
}
}
Expand Down

0 comments on commit 50e28b8

Please sign in to comment.