diff options
| author | David Skoland <davidskoland@gmail.com> | 2017-02-20 18:16:29 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2017-02-20 18:16:29 +0100 |
| commit | c04232f128937045641a3efa44f555cd7701dd1b (patch) | |
| tree | 55f79b37cf9c9f3565c702f7a7027c5c9823163f | |
| parent | 19080a613036b704f5cea08eb326550847b59a17 (diff) | |
fixed an issue where 1-frame-gifs duration would not be counted properly
| -rw-r--r-- | aocharmovie.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/aocharmovie.cpp b/aocharmovie.cpp index ddce3f2e..dcc3e9cb 100644 --- a/aocharmovie.cpp +++ b/aocharmovie.cpp @@ -71,6 +71,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) m_movie->stop(); this->clear(); m_movie->setFileName(gif_path); + m_movie->jumpToFrame(0); int full_duration = duration * time_mod; int real_duration = 0; @@ -80,7 +81,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame) { real_duration += m_movie->nextFrameDelay(); - m_movie->jumpToFrame(n_frame); + m_movie->jumpToFrame(n_frame + 1); } qDebug() << "full_duration: " << full_duration; qDebug() << "real_duration: " << real_duration; |
