Explorar o código

LibVideo/Matroska: Stop skipping a cue when seeking forward

This would cause seeks where the approximate starting cue index was one
cue before the optimal cue to not change the sample iterator position.
Fixing this issue improves accurate seek speeds significantly.
Zaggy1024 %!s(int64=2) %!d(string=hai) anos
pai
achega
1f650088a0
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp

+ 1 - 2
Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp

@@ -798,12 +798,11 @@ DecoderErrorOr<void> Reader::seek_to_cue_for_timestamp(SampleIterator& iterator,
     }
 
     while (index < cue_points.size()) {
-        auto const& cue_point = cue_points[index++];
+        auto const& cue_point = cue_points[++index];
         dbgln_if(MATROSKA_DEBUG, "Checking future cue point {}ms", cue_point.timestamp().to_milliseconds());
         if (cue_point.timestamp() > timestamp)
             break;
         prev_cue_point = &cue_point;
-        index++;
     }
 
     TRY(iterator.seek_to_cue_point(*prev_cue_point));