Skip to content

Commit

Permalink
fix seek if media has no audio stream and start time > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Aug 1, 2017
1 parent cf931f7 commit 5aa04f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AVPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,12 @@ void AVPlayer::setPosition(qint64 position)
qint64 pos_pts = position;
if (pos_pts < 0)
pos_pts = 0;
masterClock()->updateExternalClock(pos_pts); //in msec. ignore usec part using t/1000
// position passed in is relative to the start pts in relative time mode
if (relativeTimeMode())
pos_pts += absoluteMediaStartPosition();
d->seeking = true;
masterClock()->updateValue(double(pos_pts)/1000.0); //what is duration == 0
masterClock()->updateExternalClock(pos_pts); //in msec. ignore usec part using t/1000
d->read_thread->seek(pos_pts, seekType());

Q_EMIT positionChanged(position); //emit relative position
Expand Down

0 comments on commit 5aa04f3

Please sign in to comment.