Skip to content

Commit

Permalink
fix clock does not change continously if speed changed
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Oct 15, 2015
1 parent b5a2555 commit b001634
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/QtAV/AVClock.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2012-2013 Wang Bin <[email protected]>
Copyright (C) 2012-2015 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -146,17 +146,17 @@ double AVClock::value() const
} else if (clock_type == ExternalClock) {
if (timer.isValid()) {
++nb_restarted;
pts_ += double(timer.restart()) * kThousandth + avg_err;
pts_ += (double(timer.restart()) * kThousandth + avg_err)* speed();
} else {//timer is paused
//qDebug("clock is paused. return the last value %f", pts_);
}
return pts_ * speed() + value0;
return pts_ + value0;
} else {
if (timer.isValid()) {
++nb_restarted;
pts_v += double(timer.restart()) * kThousandth + avg_err;
pts_v += (double(timer.restart()) * kThousandth + avg_err)* speed();
}
return pts_v * speed(); // value0 is 1st video pts_v already
return pts_v; // value0 is 1st video pts_v already
}
}

Expand Down

0 comments on commit b001634

Please sign in to comment.