forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix clock does not change continously if speed changed
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 | ||
} | ||
} | ||
|
||
|