<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>283448</bug_id>
          
          <creation_ts>2024-11-20 16:56:54 -0800</creation_ts>
          <short_desc>[mp4] requestVideoFrameCallback returns for the wrong frame</short_desc>
          <delta_ts>2024-11-27 16:57:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2076548</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-11-20 16:56:54 -0800</bug_when>
    <thetext>In bug 

the test does:
```
        v.src = &quot;content/test-video-only.mp4&quot;;
        await waitFor(v, &apos;loadedmetadata&apos;, true);
        // time of the last video frame.
        v.currentTime = 6.009;

        const seekPromise = waitFor(v, &apos;seeked&apos;, true);
        const data = await waitForVideoFrame(v);
        testExpected(data[1].mediaTime, 6.009);
        testExpected(data[1].width, 320);
        testExpected(data[1].height, 240);
```

the time of the last frame is 6.009 to 06.042

the test fails with:
```
--- /Users/jyavenard/Work/webkit/OpenSource/WebKitBuild/Debug/layout-test-results/media/media-rvfc-paused-offscreen-mp4-expected.txt
+++ /Users/jyavenard/Work/webkit/OpenSource/WebKitBuild/Debug/layout-test-results/media/media-rvfc-paused-offscreen-mp4-actual.txt
@@ -1,4 +1,4 @@
-EXPECTED (6.009 == &apos;6.009&apos;) OK
+EXPECTED (5.976 == &apos;6.009&apos;), OBSERVED &apos;5.976&apos; FAIL
 EXPECTED (320 == &apos;320&apos;) OK
 EXPECTED (240 == &apos;240&apos;) OK
```

5.976 is the time of the second last frame.

Per spec:
```
mediaTime, of type double
The media presentation timestamp (PTS) in seconds of the frame presented (e.g. its timestamp on the video.currentTime timeline). MAY have a zero value for live-streams or WebRTC applications.
```
https://wicg.github.io/video-rvfc/#video-frame-callback-metadata-attributes

currentTime is 6.009 as this is where we seeked to.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077953</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-27 16:57:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/140638350&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>