always set clock initial value #542

the force fps logic was changed recently. if sync to external clock and
media start time != 0, clock initial value was not correctly set
This commit is contained in:
wang-bin
2015-11-04 22:00:31 +08:00
parent 884440f216
commit 507a649ad0
2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2012-2013 Wang Bin <wbsecg1@gmail.com>
Copyright (C) 2012-2015 Wang Bin <wbsecg1@gmail.com>
* This file is part of QtAV
@@ -80,6 +80,7 @@ bool AVClock::isActive() const
void AVClock::setInitialValue(double v)
{
value0 = v;
qDebug("Clock initial value: %f", v);
}
double AVClock::initialValue() const
+1 -2
View File
@@ -1221,9 +1221,8 @@ void AVPlayer::playInternal()
qDebug("Using AudioClock");
masterClock()->setClockType(AVClock::AudioClock);
}
masterClock()->setInitialValue((double)absoluteMediaStartPosition()/1000.0);
qDebug("Clock initial value: %f", masterClock()->value());
}
masterClock()->setInitialValue((double)absoluteMediaStartPosition()/1000.0);
// from previous play()
if (d->demuxer.audioCodecContext() && d->athread) {
qDebug("Starting audio thread...");