fixed an issue where 1-frame-gifs duration would not be counted properly
This commit is contained in:
parent
19080a6130
commit
c04232f128
@ -71,6 +71,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
|||||||
m_movie->stop();
|
m_movie->stop();
|
||||||
this->clear();
|
this->clear();
|
||||||
m_movie->setFileName(gif_path);
|
m_movie->setFileName(gif_path);
|
||||||
|
m_movie->jumpToFrame(0);
|
||||||
|
|
||||||
int full_duration = duration * time_mod;
|
int full_duration = duration * time_mod;
|
||||||
int real_duration = 0;
|
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)
|
for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame)
|
||||||
{
|
{
|
||||||
real_duration += m_movie->nextFrameDelay();
|
real_duration += m_movie->nextFrameDelay();
|
||||||
m_movie->jumpToFrame(n_frame);
|
m_movie->jumpToFrame(n_frame + 1);
|
||||||
}
|
}
|
||||||
qDebug() << "full_duration: " << full_duration;
|
qDebug() << "full_duration: " << full_duration;
|
||||||
qDebug() << "real_duration: " << real_duration;
|
qDebug() << "real_duration: " << real_duration;
|
||||||
|
Loading…
Reference in New Issue
Block a user