diff --git a/src/AVPlayer.cpp b/src/AVPlayer.cpp index 3bb918189..8d686a7f9 100644 --- a/src/AVPlayer.cpp +++ b/src/AVPlayer.cpp @@ -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)); @@ -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(); } diff --git a/src/QtAV/AVPlayer.h b/src/QtAV/AVPlayer.h index 0aca5348e..befa903b4 100644 --- a/src/QtAV/AVPlayer.h +++ b/src/QtAV/AVPlayer.h @@ -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::max()); /*!