<?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>214252</bug_id>
          
          <creation_ts>2020-07-13 02:59:49 -0700</creation_ts>
          <short_desc>[MSE][GStreamer] Discard PTS-less samples</short_desc>
          <delta_ts>2020-07-13 06:03:28 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alicia Boya García">aboya</reporter>
          <assigned_to name="Alicia Boya García">aboya</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>calvaris</cc>
    
    <cc>cgarcia</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>gustavo</cc>
    
    <cc>menard</cc>
    
    <cc>pnormand</cc>
    
    <cc>vjaquez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1670995</commentid>
    <comment_count>0</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2020-07-13 02:59:49 -0700</bug_when>
    <thetext>In some cases GStreamer demuxers emit PTS-less samples with metadata
at the beginning of the container. These are fortunately not necessary
for playback, and in fact incompatible with the way MSE works, where
you should be able to start playing a stream from the middle.

This patch skips these frames in the AppendPipeline so they don&apos;t
pollute other parts of the MSE codebase.

Since these frames were not necessary and were later overwritten,
this patch is just a cleanup introducing no notable behavior changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1670996</commentid>
    <comment_count>1</comment_count>
      <attachid>404138</attachid>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2020-07-13 03:02:32 -0700</bug_when>
    <thetext>Created attachment 404138
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1670997</commentid>
    <comment_count>2</comment_count>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2020-07-13 03:04:12 -0700</bug_when>
    <thetext>This a cherry picked change from the WebKitMediaSrc rework patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1671001</commentid>
    <comment_count>3</comment_count>
      <attachid>404138</attachid>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-07-13 03:25:34 -0700</bug_when>
    <thetext>Comment on attachment 404138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404138&amp;action=review

&gt; Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:464
&gt; +        // When demuxing Vorbis, matroskademux creates several PTS-less frames with header information. We don&apos;t need those.

If this is related with a specific container/codec, would it make sense to check the sample caps and proceed only for this combination?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1671002</commentid>
    <comment_count>4</comment_count>
      <attachid>404138</attachid>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2020-07-13 04:17:07 -0700</bug_when>
    <thetext>Comment on attachment 404138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404138&amp;action=review

&gt;&gt; Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:464
&gt;&gt; +        // When demuxing Vorbis, matroskademux creates several PTS-less frames with header information. We don&apos;t need those.
&gt; 
&gt; If this is related with a specific container/codec, would it make sense to check the sample caps and proceed only for this combination?

Not really. Imagine there was another container+format case where this happens, skipping these frames (which are MSE-incompatible) would still be the best outcome. Adding a further check would add more complexity for no gain: regardless of the format where they are emitted, the root problem is they are &quot;metadata&quot; samples without a presentation time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1671003</commentid>
    <comment_count>5</comment_count>
      <attachid>404138</attachid>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-07-13 04:23:07 -0700</bug_when>
    <thetext>Comment on attachment 404138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404138&amp;action=review

&gt;&gt;&gt; Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:464
&gt;&gt;&gt; +        // When demuxing Vorbis, matroskademux creates several PTS-less frames with header information. We don&apos;t need those.
&gt;&gt; 
&gt;&gt; If this is related with a specific container/codec, would it make sense to check the sample caps and proceed only for this combination?
&gt; 
&gt; Not really. Imagine there was another container+format case where this happens, skipping these frames (which are MSE-incompatible) would still be the best outcome. Adding a further check would add more complexity for no gain: regardless of the format where they are emitted, the root problem is they are &quot;metadata&quot; samples without a presentation time.

I don&apos;t really agree, I prefer to be explicit in this case. But I don&apos;t have the energy to discuss about this.
Anyway, this doesn&apos;t impact live streams broadcasted on youtube.com/live?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1671004</commentid>
    <comment_count>6</comment_count>
      <attachid>404138</attachid>
    <who name="Alicia Boya García">aboya</who>
    <bug_when>2020-07-13 04:44:25 -0700</bug_when>
    <thetext>Comment on attachment 404138
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404138&amp;action=review

&gt;&gt;&gt;&gt; Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:464
&gt;&gt;&gt;&gt; +        // When demuxing Vorbis, matroskademux creates several PTS-less frames with header information. We don&apos;t need those.
&gt;&gt;&gt; 
&gt;&gt;&gt; If this is related with a specific container/codec, would it make sense to check the sample caps and proceed only for this combination?
&gt;&gt; 
&gt;&gt; Not really. Imagine there was another container+format case where this happens, skipping these frames (which are MSE-incompatible) would still be the best outcome. Adding a further check would add more complexity for no gain: regardless of the format where they are emitted, the root problem is they are &quot;metadata&quot; samples without a presentation time.
&gt; 
&gt; I don&apos;t really agree, I prefer to be explicit in this case. But I don&apos;t have the energy to discuss about this.
&gt; Anyway, this doesn&apos;t impact live streams broadcasted on youtube.com/live?

I see no benefit in adding more conditions, for the reasons explained above. The only case in which it could make sense to me would be if I asserted on the caps inside the `if` block (e.g. this only happens for Vorbis streams), but it feels a bit overkill.

It doesn&apos;t impact live streams. Live streams frames contain PTS just like regular videos do. All frames in MSE need a PTS. You can indeed open a developer console and inspect `$(&quot;video&quot;).buffered` in a YouTube live to see how this is the case. The only difference with live streams is that there is not necessarily a frame with PTS=0, implementations may make the live start at whatever PTS they want.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1671010</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-07-13 06:03:26 -0700</bug_when>
    <thetext>Committed r264299: &lt;https://trac.webkit.org/changeset/264299&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404138.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>404138</attachid>
            <date>2020-07-13 03:02:32 -0700</date>
            <delta_ts>2020-07-13 06:03:27 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-214252-20200713120231.patch</filename>
            <type>text/plain</type>
            <size>2336</size>
            <attacher name="Alicia Boya García">aboya</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjY0MjExCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggYWIwZTUxNTg0ZWJmNThi
NmU2Nzk1MTU3MTNmNjk1NzNhNmYwZjE1Mi4uMDdlMjNjZDM0ODVhMDY3ZTA5MGJiYjgxMThiYWVj
OTBhNjA3MjBiZCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBi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