File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1105,7 +1105,11 @@ bool SingleStreamDecoder::canWeAvoidSeeking() const {
11051105 // within getFramesPlayedInRangeAudio(), when setCursorPtsInSeconds() was
11061106 // called. For more context, see [Audio Decoding Design]
11071107 return !cursorWasJustSet_;
1108+ } else if (!cursorWasJustSet_) {
1109+ // For videos, when decoding consecutive frames, we don't need to seek.
1110+ return true ;
11081111 }
1112+
11091113 if (cursor_ < lastDecodedAvFramePts_) {
11101114 // We can never skip a seek if we are seeking backwards.
11111115 return false ;
@@ -1181,10 +1185,8 @@ UniqueAVFrame SingleStreamDecoder::decodeAVFrame(
11811185
11821186 resetDecodeStats ();
11831187
1184- if (cursorWasJustSet_) {
1185- maybeSeekToBeforeDesiredPts ();
1186- cursorWasJustSet_ = false ;
1187- }
1188+ maybeSeekToBeforeDesiredPts ();
1189+ cursorWasJustSet_ = false ;
11881190
11891191 UniqueAVFrame avFrame (av_frame_alloc ());
11901192 AutoAVPacket autoAVPacket;
You can’t perform that action at this time.
0 commit comments