Skip to content

Commit

Permalink
do not reset repeat max in stop
Browse files Browse the repository at this point in the history
must set by user
  • Loading branch information
wang-bin committed May 29, 2016
1 parent a64236b commit 77833f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AVPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1320,10 1320,10 @@ void AVPlayer::stopFromDemuxerThread()
stop_pts = masterClock()->value();
masterClock()->reset();
stopNotifyTimer();
// vars not set by user can be reset
d->start_position_norm = 0;
d->stop_position_norm = kInvalidPosition; // already stopped. so not 0 but invalid. 0 can stop the playback in timerEvent
d->media_end = kInvalidPosition;
d->repeat_current = d->repeat_max = 0;
qDebug("avplayer emit stopped()");
d->state = StoppedState;
QMetaObject::invokeMethod(this, "stateChanged", Q_ARG(QtAV::AVPlayer::State, d->state));
Expand Down Expand Up @@ -1454,10 1454,10 @@ void AVPlayer::stop()
//TODO: post event.
}
}
// vars not set by user can be reset
d->start_position_norm = 0;
d->stop_position_norm = 0; // 0 can stop play in timerEvent
d->media_end = kInvalidPosition;
d->repeat_current = d->repeat_max = 0;
} else { //called by player
stopNotifyTimer();
}
Expand Down
1 change: 1 addition & 0 deletions src/QtAV/AVPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 438,7 @@ public slots:
* \brief stopPosition
* pos > mediaStopPosition(): mediaStopPosition()
* pos < 0: duration() pos
* With the default value, the playback will not stop until the end of media (including dynamically changed media duration, e.g. recording video)
*/
void setStopPosition(qint64 pos = std::numeric_limits<qint64>::max());
/*!
Expand Down

0 comments on commit 77833f4

Please sign in to comment.