<?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>197355</bug_id>
          
          <creation_ts>2019-04-28 13:07:12 -0700</creation_ts>
          <short_desc>[GStreamer][MSE] Pausing video sometimes causes skip to finish</short_desc>
          <delta_ts>2019-06-24 04:34:32 -0700</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>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Charlie Turner">cturner</assigned_to>
          <cc>aboya</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>commit-queue</cc>
    
    <cc>cturner</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pnormand</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1531075</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-04-28 13:07:12 -0700</bug_when>
    <thetext>Since we enabled MSE, pausing a YouTube video occasionally (but not usually and not often) causes the video to improperly skip to the very end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1539659</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2019-05-28 11:10:12 -0700</bug_when>
    <thetext>*** Bug 198054 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546548</commentid>
    <comment_count>2</comment_count>
      <attachid>372562</attachid>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2019-06-20 09:50:43 -0700</bug_when>
    <thetext>Created attachment 372562
Patch

WIP/demonstation patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546549</commentid>
    <comment_count>3</comment_count>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2019-06-20 09:51:58 -0700</bug_when>
    <thetext>This is easily reproducible on trunk. The way to trigger it is to seek very close to the end, let WebCore::MediaSource::endOfStream run, which will in turn call WebCore::MediaSource::streamEndedWithError, which in the GStreamerMSE player will set m_eosMarked = true, which in turn will set m_eosPending in updateStates(), which then breaks MediaPlayerPrivateGStreamerMSE::currentMediaTime, since after these steps it thinks the network resource is fully loaded and that the end has been reached (actually it just buffered to the end), and this in turn sets the cached playback position to the end and we get a jump.

Looking at this code I see all sorts of strange issues. We have a downstream port that doesn&apos;t have such blatant problems on YouTube, and I see a large diff in these areas which we should work on getting upstream.

The other complication here is that there&apos;s large MSE refactoring Alicia is doing in parallel that probably touches this, so the MSE folks will have a much better idea what is the best way to fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546550</commentid>
    <comment_count>4</comment_count>
    <who name="EWS Watchlist">ews-watchlist</who>
    <bug_when>2019-06-20 09:52:52 -0700</bug_when>
    <thetext>Attachment 372562 did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:10:  You should remove the &apos;No new tests&apos; and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546551</commentid>
    <comment_count>5</comment_count>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2019-06-20 09:54:06 -0700</bug_when>
    <thetext>To clarify, the WIP/demonstration patch is not for review, I put here to pinpoint where the bug is, this patch fixes the jumping issue for me, but I have no idea what else it may break, and the right thing to do is surely to focus on getting our downstream code up here and/or waiting for the refactoring.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546582</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-06-20 11:13:56 -0700</bug_when>
    <thetext>Thanks Charlie!

Alicia, what do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546649</commentid>
    <comment_count>7</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2019-06-20 14:00:53 -0700</bug_when>
    <thetext>I have no idea why `paused()` was there in that condition, so on first sight the patch LGTM.

In the current state of my rework markEndOfStream() is empty, as it has no business with neither the AppendPipeline nor (directly) the playback pipeline.

Instead I rely on allSamplesInTrackEnqueued(), which SourceBuffer calls when the source is &quot;ended&quot; (.endOfStream() has been called) AND the decode queue is empty. When this method is fired an EOS event is enqueued into WebKitMediaSrc. 

MediaPlayerPrivateGStreamerMSE::currentMediaTime() does not even exist anymore in my rework, so your patch won&apos;t cause a lot of trouble other than a rebase conflict.

If it does not cause regressions on LayoutTests or YT tests I&apos;m OK with it landing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546862</commentid>
    <comment_count>8</comment_count>
      <attachid>372627</attachid>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2019-06-21 06:44:35 -0700</bug_when>
    <thetext>Created attachment 372627
Patch

Try this patch in the bots commit queues. Locally I see a huge number of failures, but it may be my local environment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546870</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-06-21 07:21:44 -0700</bug_when>
    <thetext>None of the test EWS are going to run this code. If you want to see what happens to the bots, you just have to land it.

Safe to say that if it introduces a huge number of failures in your local environment that were not there before, there is a problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546874</commentid>
    <comment_count>10</comment_count>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2019-06-21 07:58:33 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #9)
&gt; None of the test EWS are going to run this code. If you want to see what
&gt; happens to the bots, you just have to land it.
&gt; 
&gt; Safe to say that if it introduces a huge number of failures in your local
&gt; environment that were not there before, there is a problem.

Obviously I would be aware of that, the issue is that I have so many failures for other reasons with my environment that I can&apos;t see the signal for the noise at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546876</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-06-21 08:24:25 -0700</bug_when>
    <thetext>OK, just making sure you understand: neither the EWS nor the commit queue test GTK/WPE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1546958</commentid>
    <comment_count>12</comment_count>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2019-06-21 13:15:24 -0700</bug_when>
    <thetext>I see. This patch doesn&apos;t regress any tests in media/ or imported/w3c/web-platform-tests/media-source for me. Let&apos;s land it on Monday when I can monitor the bots closely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547287</commentid>
    <comment_count>13</comment_count>
      <attachid>372627</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-06-24 04:33:37 -0700</bug_when>
    <thetext>Comment on attachment 372627
Patch

Clearing flags on attachment: 372627

Committed r246731: &lt;https://trac.webkit.org/changeset/246731&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547288</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-06-24 04:33:39 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547289</commentid>
    <comment_count>15</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-06-24 04:34:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/52049850&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>372562</attachid>
            <date>2019-06-20 09:50:43 -0700</date>
            <delta_ts>2019-06-21 06:44:31 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-197355-20190620175042.patch</filename>
            <type>text/plain</type>
            <size>1965</size>
            <attacher name="Charlie Turner">cturner</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQ2NTM2CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggNjgxY2NiNjIxNWY4NTJi
ZmIyNjY5Yjg2NjdlMTkwYTI5ODk1MTEzYy4uMjcxZTljNTQwMmI2NDE2MTY2NjQ0YmI2MWY2YjUy
OTY1NjViMmU0MiAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDIwIEBACisyMDE5LTA2LTIwICBDaGFy
bGllIFR1cm5lciAgPGN0dXJuZXJAaWdhbGlhLmNvbT4KKworICAgICAgICBbR1N0cmVhbWVyXVtN
U0VdIFBhdXNpbmcgdmlkZW8gc29tZXRpbWVzIGNhdXNlcyBza2lwIHRvIGZpbmlzaAorICAgICAg
ICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTk3MzU1CisKKyAgICAg
ICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgV29yayBpbiBwcm9ncmVz
cz8KKworICAgICAgICBObyBuZXcgdGVzdHMgKE9PUFMhKS4KKworICAgICAgICAqIHBsYXRmb3Jt
L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YkNvcmUvcGxhdGZvcm0vZ3Jh
cGhpY3MvZ3N0cmVhbWVyL21zZS9NZWRpYVBsYXllclByaXZhdGVHU3RyZWFtZXJNU0UuY3BwCisr
KyBiL1NvdXJjZS9XZWJDb3JlL3BsYXRmb3JtL2dyYXBoaWNzL2dzdHJlYW1lci9tc2UvTWVkaWFQ
bGF5ZXJQcml2YXRlR1N0cmVhbWVyTVNFLmNwcApAQCAtNzU4LDcgKzc1OCw3IEBAIE1lZGlhVGlt
ZSBNZWRpYVBsYXllclByaXZhdGVHU3RyZWFtZXJNU0U6OmN1cnJlbnRNZWRpYVRpbWUoKSBjb25z
dAogewogICAgIE1lZGlhVGltZSBwb3NpdGlvbiA9IE1lZGlhUGxheWVyUHJpdmF0ZUdTdHJlYW1l
cjo6Y3VycmVudE1lZGlhVGltZSgpOwogCi0gICAgaWYgKG1fZW9zUGVuZGluZyAmJiAocGF1c2Vk
KCkgfHwgKHBvc2l0aW9uID49IGR1cmF0aW9uTWVkaWFUaW1lKCkpKSkgeworICAgIGlmIChtX2Vv
c1BlbmRpbmcgJiYgcG9zaXRpb24gPj0gZHVyYXRpb25NZWRpYVRpbWUoKSkgewogICAgICAgICBp
ZiAobV9uZXR3b3JrU3RhdGUgIT0gTWVkaWFQbGF5ZXI6OkxvYWRlZCkgewogICAgICAgICAgICAg
bV9uZXR3b3JrU3RhdGUgPSBNZWRpYVBsYXllcjo6TG9hZGVkOwogICAgICAgICAgICAgbV9wbGF5
ZXItPm5ldHdvcmtTdGF0ZUNoYW5nZWQoKTsK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>372627</attachid>
            <date>2019-06-21 06:44:35 -0700</date>
            <delta_ts>2019-06-24 04:33:37 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-197355-20190621144434.patch</filename>
            <type>text/plain</type>
            <size>1941</size>
            <attacher name="Charlie Turner">cturner</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZX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