@@ -746,7 +746,7 @@ void VideoDecoder::maybeSeekToBeforeDesiredPts() {
746746 for (int streamIndex : activeStreamIndices_) {
747747 StreamInfo& streamInfo = streamInfos_[streamIndex];
748748 // clang-format off: clang format clashes
749- streamInfo.discardFramesBeforePts = secondsToClosestPts (*maybeDesiredPts_ , streamInfo.timeBase );
749+ streamInfo.discardFramesBeforePts = secondsToClosestPts (*desiredPtsSeconds_ , streamInfo.timeBase );
750750 // clang-format on
751751 }
752752
@@ -756,7 +756,7 @@ void VideoDecoder::maybeSeekToBeforeDesiredPts() {
756756 bool mustSeek = false ;
757757 for (int streamIndex : activeStreamIndices_) {
758758 StreamInfo& streamInfo = streamInfos_[streamIndex];
759- int64_t desiredPtsForStream = *maybeDesiredPts_ * streamInfo.timeBase .den ;
759+ int64_t desiredPtsForStream = *desiredPtsSeconds_ * streamInfo.timeBase .den ;
760760 if (!canWeAvoidSeekingForStream (
761761 streamInfo, streamInfo.currentPts , desiredPtsForStream)) {
762762 mustSeek = true ;
@@ -770,7 +770,7 @@ void VideoDecoder::maybeSeekToBeforeDesiredPts() {
770770 int firstActiveStreamIndex = *activeStreamIndices_.begin ();
771771 const auto & firstStreamInfo = streamInfos_[firstActiveStreamIndex];
772772 int64_t desiredPts =
773- secondsToClosestPts (*maybeDesiredPts_ , firstStreamInfo.timeBase );
773+ secondsToClosestPts (*desiredPtsSeconds_ , firstStreamInfo.timeBase );
774774
775775 // For some encodings like H265, FFMPEG sometimes seeks past the point we
776776 // set as the max_ts. So we use our own index to give it the exact pts of
@@ -809,9 +809,9 @@ VideoDecoder::RawDecodedOutput VideoDecoder::getDecodedOutputWithFilter(
809809 throw std::runtime_error (" No active streams configured." );
810810 }
811811 resetDecodeStats ();
812- if (maybeDesiredPts_ .has_value ()) {
812+ if (desiredPtsSeconds_ .has_value ()) {
813813 maybeSeekToBeforeDesiredPts ();
814- maybeDesiredPts_ = std::nullopt ;
814+ desiredPtsSeconds_ = std::nullopt ;
815815 }
816816 // Need to get the next frame or error from PopFrame.
817817 UniqueAVFrame avFrame (av_frame_alloc ());
@@ -1487,7 +1487,7 @@ VideoDecoder::DecodedOutput VideoDecoder::getNextFrameNoDemuxInternal(
14871487}
14881488
14891489void VideoDecoder::setCursorPtsInSeconds (double seconds) {
1490- maybeDesiredPts_ = seconds;
1490+ desiredPtsSeconds_ = seconds;
14911491}
14921492
14931493VideoDecoder::DecodeStats VideoDecoder::getDecodeStats () const {
0 commit comments