Skip to content

Commit

Permalink
rename AVClock.videoPts to videoTime
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Dec 24, 2014
1 parent 4d13802 commit a2df3ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/AudioThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ void AudioThread::run()
* audio may be too fast than video if skip without sleep
* a frame is about 20ms. sleep time must be << frame time
*/
qreal a_v = dts - d.clock->videoPts();
//qDebug("skip audio decode at %f/%f v=%f a-v=%fms", dts, d.render_pts0, d.clock->videoPts(), a_v*1000.0);
qreal a_v = dts - d.clock->videoTime();
//qDebug("skip audio decode at %f/%f v=%f a-v=%fms", dts, d.render_pts0, d.clock->videoTime(), a_v*1000.0);
if (a_v > 0) {
msleep(qMin((ulong)20, ulong(a_v*1000.0)));
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/QtAV/AVClock.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class Q_AV_EXPORT AVClock : public QObject
/*external clock outside still running, so it's more accurate for syncing multiple clocks serially*/
void updateExternalClock(const AVClock& clock);

inline void updateVideoPts(double pts);
inline double videoPts() const;
inline void updateVideoTime(double pts);
inline double videoTime() const;
inline double delay() const; //playing audio spends some time
inline void updateDelay(double delay);

Expand Down Expand Up @@ -162,14 +162,14 @@ void AVClock::updateValue(double pts)
pts_ = pts;
}

void AVClock::updateVideoPts(double pts)
void AVClock::updateVideoTime(double pts)
{
pts_v = pts;
if (clock_type == VideoClock)
timer.restart();
}

double AVClock::videoPts() const
double AVClock::videoTime() const
{
return pts_v;
}
Expand Down
2 changes: 1 addition & 1 deletion src/VideoThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void VideoThread::run()
diff = 0; // TODO: can not change delay!
}
// update here after wait
d.clock->updateVideoPts(pts); // dts or pts?
d.clock->updateVideoTime(pts); // dts or pts?
seeking = !qFuzzyIsNull(d.render_pts0);
if (qAbs(diff) < 0.5) {
if (diff < -kSyncThreshold) { //Speed up. drop frame?
Expand Down

0 comments on commit a2df3ec

Please sign in to comment.