<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[200454] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200454">200454</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-05 01:40:21 -0700 (Thu, 05 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GStreamer] Bump internal jhbuild versions to 1.8.0 and patches to support MSE
https://bugs.webkit.org/show_bug.cgi?id=157341

Patch by Enrique Ocaña González &lt;eocanha@igalia.com&gt; on 2016-05-05
Reviewed by Xabier Rodriguez-Calvar.

* gtk/jhbuild.modules:
* gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch: Added.
* gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsgtkjhbuildmodules">trunk/Tools/gtk/jhbuild.modules</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsgtkpatchesgstpluginsgoodRevertqtdemuxexposestreamswithfirstmoofforfrpatch">trunk/Tools/gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch</a></li>
<li><a href="#trunkToolsgtkpatchesgstpluginsgoodusethetfdtdecodetimepatch">trunk/Tools/gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (200453 => 200454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-05-05 08:25:23 UTC (rev 200453)
+++ trunk/Tools/ChangeLog        2016-05-05 08:40:21 UTC (rev 200454)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-05-05  Enrique Ocaña González  &lt;eocanha@igalia.com&gt;
+
+        [GStreamer] Bump internal jhbuild versions to 1.8.0 and patches to support MSE
+        https://bugs.webkit.org/show_bug.cgi?id=157341
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * gtk/jhbuild.modules:
+        * gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch: Added.
+        * gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch: Added.
+
</ins><span class="cx"> 2016-05-04  Srinivasan Vijayaraghavan  &lt;svijayaraghavan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add JSC test results in JSON format to a Buildbot log
</span></span></pre></div>
<a id="trunkToolsgtkjhbuildmodules"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/jhbuild.modules (200453 => 200454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/jhbuild.modules        2016-05-05 08:25:23 UTC (rev 200453)
+++ trunk/Tools/gtk/jhbuild.modules        2016-05-05 08:40:21 UTC (rev 200454)
</span><span class="lines">@@ -333,10 +333,10 @@
</span><span class="cx">     &lt;dependencies&gt;
</span><span class="cx">       &lt;dep package=&quot;orc&quot;/&gt;
</span><span class="cx">     &lt;/dependencies&gt;
</span><del>-    &lt;branch module=&quot;gstreamer/gstreamer-${version}.tar.xz&quot; version=&quot;1.6.3&quot;
</del><ins>+    &lt;branch module=&quot;gstreamer/gstreamer-${version}.tar.xz&quot; version=&quot;1.8.0&quot;
</ins><span class="cx">             repo=&quot;gstreamer&quot;
</span><del>-            hash=&quot;sha256:22f9568d67b87cf700a111f381144bd37cb93790a77e4e331db01fe854a37f24&quot;
-            md5sum=&quot;b4cdeb2b9cb20dd6ac022a4f417eae0d&quot;/&gt;
</del><ins>+            hash=&quot;sha256:947a314a212b5d94985d89b43440dbe66b696e12bbdf9a2f78967b98d74abedc&quot;
+            md5sum=&quot;6846d7289ec323c38c49b818171e955a&quot;/&gt;
</ins><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;autotools id=&quot;gst-plugins-base&quot;
</span><span class="lines">@@ -348,10 +348,10 @@
</span><span class="cx">     &lt;dependencies&gt;
</span><span class="cx">       &lt;dep package=&quot;gstreamer&quot;/&gt;
</span><span class="cx">     &lt;/dependencies&gt;
</span><del>-    &lt;branch module=&quot;gst-plugins-base/gst-plugins-base-${version}.tar.xz&quot; version=&quot;1.6.3&quot;
</del><ins>+    &lt;branch module=&quot;gst-plugins-base/gst-plugins-base-${version}.tar.xz&quot; version=&quot;1.8.0&quot;
</ins><span class="cx">             repo=&quot;gstreamer&quot;
</span><del>-            hash=&quot;sha256:b6154f8fdba4877e95efd94610ef0ada4f0171cd12eb829a3c3c97345d9c7a75&quot;
-            md5sum=&quot;3ddde0ad598ef69f58d6a2e87f8b460f&quot;/&gt;
</del><ins>+            hash=&quot;sha256:abc0acc1d15b4b9c97c65cd9689bd6400081853b9980ea428d3c8572dd791522&quot;
+            md5sum=&quot;20cc8231609318310f2a55f64c86cbb4&quot;/&gt;
</ins><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;autotools id=&quot;gst-plugins-good&quot; autogenargs=&quot;--disable-examples --disable-soup --disable-gtk-doc&quot;&gt;
</span><span class="lines">@@ -362,10 +362,13 @@
</span><span class="cx">       &lt;dep package=&quot;gst-plugins-base&quot;/&gt;
</span><span class="cx">     &lt;/dependencies&gt;
</span><span class="cx"> 
</span><del>-    &lt;branch module=&quot;gst-plugins-good/gst-plugins-good-${version}.tar.xz&quot; version=&quot;1.6.3&quot;
</del><ins>+    &lt;branch module=&quot;gst-plugins-good/gst-plugins-good-${version}.tar.xz&quot; version=&quot;1.8.0&quot;
</ins><span class="cx">             repo=&quot;gstreamer&quot;
</span><del>-            hash=&quot;sha256:24b19db70b2a83461ebddfe20033db432dadfdb5d4b54ffb1dfa0d830134a177&quot;
-            md5sum=&quot;a1958df7aa498b42793e2f2048673815&quot;/&gt;
</del><ins>+            hash=&quot;sha256:c20c134d47dbc238d921707a3b66da709c2b4dd89f9d267cec13d1ddf16e9f4d&quot;
+            md5sum=&quot;91ed4649c7c2e43a61f731d144f6f6d0&quot;&gt;
+      &lt;patch file=&quot;gst-plugins-good-use-the-tfdt-decode-time.patch&quot; strip=&quot;1&quot;/&gt;
+      &lt;patch file=&quot;gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch&quot; strip=&quot;1&quot;/&gt;
+    &lt;/branch&gt;
</ins><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;autotools id=&quot;gst-plugins-bad&quot; autogenargs=&quot;--disable-examples --disable-gtk-doc&quot;&gt;
</span><span class="lines">@@ -375,20 +378,20 @@
</span><span class="cx">     &lt;dependencies&gt;
</span><span class="cx">       &lt;dep package=&quot;gst-plugins-base&quot;/&gt;
</span><span class="cx">     &lt;/dependencies&gt;
</span><del>-    &lt;branch module=&quot;gst-plugins-bad/gst-plugins-bad-${version}.tar.xz&quot; version=&quot;1.6.3&quot;
</del><ins>+    &lt;branch module=&quot;gst-plugins-bad/gst-plugins-bad-${version}.tar.xz&quot; version=&quot;1.8.0&quot;
</ins><span class="cx">             repo=&quot;gstreamer&quot;
</span><del>-            hash=&quot;sha256:971b29101d6a9c5e3fe94d99d977a227f58f0b2d29b6ca2c7f292052542b3a61&quot;
-            md5sum=&quot;4857adcafe41e4b9b8805cf88303bd55&quot;/&gt;
</del><ins>+            hash=&quot;sha256:116376dd1085082422e0b21b0ecd3d1cb345c469c58e32463167d4675f4ca90e&quot;
+            md5sum=&quot;1c2d797bb96a81e9ef570c7a0a37203e&quot;/&gt;
</ins><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;autotools id=&quot;gst-libav&quot; autogenargs=&quot;--with-libav-extra-configure='--disable-yasm' --disable-gtk-doc&quot;&gt;
</span><span class="cx">     &lt;dependencies&gt;
</span><span class="cx">       &lt;dep package=&quot;gst-plugins-base&quot;/&gt;
</span><span class="cx">     &lt;/dependencies&gt;
</span><del>-    &lt;branch module=&quot;gst-libav/gst-libav-${version}.tar.xz&quot; version=&quot;1.6.3&quot;
</del><ins>+    &lt;branch module=&quot;gst-libav/gst-libav-${version}.tar.xz&quot; version=&quot;1.8.0&quot;
</ins><span class="cx">             repo=&quot;gstreamer&quot;
</span><del>-            hash=&quot;sha256:857b9c060a0337de38c6d26238c47352433c02eabf26c2f860c854dbc35bd4ab&quot;
-            md5sum=&quot;cfe9a06913d4fd4067e9e47f6e05fac2&quot;/&gt;
</del><ins>+            hash=&quot;sha256:5a1ce28876aee93cb4f3d090f0e807915a5d9bc1325e3480dd302b85aeb4291c&quot;
+            md5sum=&quot;361638fa45466c5050bcde6bfe10fa46&quot;/&gt;
</ins><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><span class="cx">   &lt;autotools id=&quot;xserver&quot; autogenargs=&quot;--disable-xinerama --enable-glx --enable-composite --disable-xorg --disable-dmx --disable-xnest --disable-xquartz --disable-xwin --disable-xephyr --disable-xfake --disable-xfbdev --disable-install-setuid --disable-unit-tests --disable-present --enable-unix-transport --enable-tcp-transport --disable-local-transport --with-xkb-path=/usr/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/usr/bin --without-dtrace&quot;&gt;
</span></span></pre></div>
<a id="trunkToolsgtkpatchesgstpluginsgoodRevertqtdemuxexposestreamswithfirstmoofforfrpatch"></a>
<div class="addfile"><h4>Added: trunk/Tools/gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch (0 => 200454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch                                (rev 0)
+++ trunk/Tools/gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch        2016-05-05 08:40:21 UTC (rev 200454)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+From 1a81bd90d4a3e59d6669a0bbfa456f1ed4e5db48 Mon Sep 17 00:00:00 2001
+From: Xabier Rodriguez Calvar &lt;calvaris@igalia.com&gt;
+Date: Thu, 7 Apr 2016 13:57:16 +0200
+Subject: [PATCH] Revert &quot;qtdemux: expose streams with first moof for
+ fragmented format&quot;
+
+This reverts commit d8bb6687ea251570c331038279a43d448167d6ad.
+---
+ gst/isomp4/qtdemux.c | 54 ++++++++++++++++------------------------------------
+ gst/isomp4/qtdemux.h |  1 -
+ 2 files changed, 16 insertions(+), 39 deletions(-)
+
+diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
+index 39be163..9636b4b 100644
+--- a/gst/isomp4/qtdemux.c
++++ b/gst/isomp4/qtdemux.c
+@@ -609,7 +609,6 @@ gst_qtdemux_init (GstQTDemux * qtdemux)
+   qtdemux-&gt;state = QTDEMUX_STATE_INITIAL;
+   qtdemux-&gt;pullbased = FALSE;
+   qtdemux-&gt;posted_redirect = FALSE;
+-  qtdemux-&gt;pending_configure = FALSE;
+   qtdemux-&gt;neededbytes = 16;
+   qtdemux-&gt;todrop = 0;
+   qtdemux-&gt;adapter = gst_adapter_new ();
+@@ -2049,7 +2048,6 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
+     gst_caps_replace (&amp;qtdemux-&gt;media_caps, NULL);
+     qtdemux-&gt;timescale = 0;
+     qtdemux-&gt;got_moov = FALSE;
+-    qtdemux-&gt;pending_configure = FALSE;
+   } else if (qtdemux-&gt;mss_mode) {
+     gst_flow_combiner_reset (qtdemux-&gt;flowcombiner);
+     for (n = 0; n &lt; qtdemux-&gt;n_streams; n++)
+@@ -6104,7 +6102,6 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
+             &amp;fourcc);
+         if (fourcc == FOURCC_moov) {
+           gint n;
+-          gboolean got_samples = FALSE;

+           /* in usual fragmented setup we could try to scan for more
+            * and end up at the the moov (after mdat) again */
+@@ -6136,27 +6133,19 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
+             qtdemux_node_dump (demux, demux-&gt;moov_node);
+             qtdemux_parse_tree (demux);
+             qtdemux_prepare_streams (demux);
++            if (!demux-&gt;got_moov)
++              qtdemux_expose_streams (demux);
++            else {

+-            for (n = 0; n &lt; demux-&gt;n_streams; n++) {
+-              QtDemuxStream *stream = demux-&gt;streams[n];
+-              got_samples |= stream-&gt;stbl_index &gt;= 0;
+-            }
+-            if (!demux-&gt;fragmented || got_samples) {
+-              if (!demux-&gt;got_moov) {
+-                qtdemux_expose_streams (demux);
+-              } else {
+-                for (n = 0; n &lt; demux-&gt;n_streams; n++) {
+-                  QtDemuxStream *stream = demux-&gt;streams[n];
+-                  gst_qtdemux_configure_stream (demux, stream);
+-                }
++              for (n = 0; n &lt; demux-&gt;n_streams; n++) {
++                QtDemuxStream *stream = demux-&gt;streams[n];
++
++                gst_qtdemux_configure_stream (demux, stream);
+               }
+-              gst_qtdemux_check_send_pending_segment (demux);
+-              demux-&gt;pending_configure = FALSE;
+-            } else {
+-              demux-&gt;pending_configure = TRUE;
+             }

+             demux-&gt;got_moov = TRUE;
++            gst_qtdemux_check_send_pending_segment (demux);

+             /* fragmented streams headers shouldn't contain edts atoms */
+             if (!demux-&gt;fragmented) {
+@@ -6175,7 +6164,6 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
+             guint64 dist = 0;
+             GstClockTime prev_pts;
+             guint64 prev_offset;
+-            gint n;

+             GST_DEBUG_OBJECT (demux, &quot;Parsing [moof]&quot;);

+@@ -6209,25 +6197,15 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
+               ret = GST_FLOW_ERROR;
+               goto done;
+             }
+-            /* in MSS we need to expose the pads after the first moof as we won't get a moov 
+-             * Also, fragmented format need to be exposed if a moov have no valid sample data */
+-            if (demux-&gt;mss_mode || demux-&gt;pending_configure) {
+-              if (!demux-&gt;exposed) {
+-                if (!demux-&gt;pending_newsegment) {
+-                  GstSegment segment;
+-                  gst_segment_init (&amp;segment, GST_FORMAT_TIME);
+-                  GST_DEBUG_OBJECT (demux, &quot;new pending_newsegment&quot;);
+-                  demux-&gt;pending_newsegment = gst_event_new_segment (&amp;segment);
+-                }
+-                qtdemux_expose_streams (demux);
+-              } else {
+-                for (n = 0; n &lt; demux-&gt;n_streams; n++) {
+-                  QtDemuxStream *stream = demux-&gt;streams[n];
+-                  gst_qtdemux_configure_stream (demux, stream);
+-                }
++            /* in MSS we need to expose the pads after the first moof as we won't get a moov */
++            if (demux-&gt;mss_mode &amp;&amp; !demux-&gt;exposed) {
++              if (!demux-&gt;pending_newsegment) {
++                GstSegment segment;
++                gst_segment_init (&amp;segment, GST_FORMAT_TIME);
++                GST_DEBUG_OBJECT (demux, &quot;new pending_newsegment&quot;);
++                demux-&gt;pending_newsegment = gst_event_new_segment (&amp;segment);
+               }
+-              gst_qtdemux_check_send_pending_segment (demux);
+-              demux-&gt;pending_configure = FALSE;
++              qtdemux_expose_streams (demux);
+             }
+           } else {
+             GST_DEBUG_OBJECT (demux, &quot;Discarding [moof]&quot;);
+diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h
+index 6061215..ecf0c63 100644
+--- a/gst/isomp4/qtdemux.h
++++ b/gst/isomp4/qtdemux.h
+@@ -89,7 +89,6 @@ struct _GstQTDemux {
+   gboolean posted_redirect;

+   /* push based variables */
+-  gboolean pending_configure;
+   guint neededbytes;
+   guint todrop;
+   GstAdapter *adapter;
+-- 
+2.8.0.rc3
+
</ins></span></pre></div>
<a id="trunkToolsgtkpatchesgstpluginsgoodusethetfdtdecodetimepatch"></a>
<div class="addfile"><h4>Added: trunk/Tools/gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch (0 => 200454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch                                (rev 0)
+++ trunk/Tools/gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch        2016-05-05 08:40:21 UTC (rev 200454)
</span><span class="lines">@@ -0,0 +1,146 @@
</span><ins>+From 46d3e0faa922643094a5e46a32e4f82f774ae772 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= &lt;eocanha@igalia.com&gt;
+Date: Tue, 10 Nov 2015 13:09:00 +0100
+Subject: [PATCH] Use the tfdt decode time when it's significantly different
+ than the time in the last sample if always-honor-tfdt is enabled
+
+https://bugzilla.gnome.org/show_bug.cgi?id=754230
+---
+ gst/isomp4/qtdemux.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ gst/isomp4/qtdemux.h |  1 +
+ 2 files changed, 73 insertions(+)
+
+diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
+index 880595e..d8b54f0 100644
+--- a/gst/isomp4/qtdemux.c
++++ b/gst/isomp4/qtdemux.c
+@@ -535,6 +535,11 @@ static void gst_qtdemux_append_protection_system_id (GstQTDemux * qtdemux,
+     const gchar * id);
+ static void qtdemux_gst_structure_free (GstStructure * gststructure);

++static void gst_qtdemux_set_property (GObject * object, guint prop_id,
++    const GValue * value, GParamSpec * spec);
++static void gst_qtdemux_get_property (GObject * object, guint prop_id,
++    GValue * value, GParamSpec * spec);
++
+ static void
+ gst_qtdemux_class_init (GstQTDemuxClass * klass)
+ {
+@@ -546,8 +551,21 @@ gst_qtdemux_class_init (GstQTDemuxClass * klass)

+   parent_class = g_type_class_peek_parent (klass);

++  gobject_class-&gt;set_property = gst_qtdemux_set_property;
++  gobject_class-&gt;get_property = gst_qtdemux_get_property;
++
+   gobject_class-&gt;dispose = gst_qtdemux_dispose;

++ /**
++   * GstQtDemux::always-honor-tfdt:
++   *
++   * Requests the demuxer to respect what the TFDT atom says in order to produce presentation timestamps. Defaults to FALSE.
++   */
++  g_object_class_install_property (gobject_class, PROP_ALWAYS_HONOR_TFDT,
++      g_param_spec_boolean (&quot;always-honor-tfdt&quot;, &quot;Always honor TFDT&quot;,
++          &quot;When enabled, TFDT atom will always be respected in order to produce presentation timestamps&quot;,
++          FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
++
+   gstelement_class-&gt;change_state = GST_DEBUG_FUNCPTR (gst_qtdemux_change_state);
+ #if 0
+   gstelement_class-&gt;set_index = GST_DEBUG_FUNCPTR (gst_qtdemux_set_index);
+@@ -611,6 +629,7 @@ gst_qtdemux_init (GstQTDemux * qtdemux)
+   qtdemux-&gt;cenc_aux_info_sizes = NULL;
+   qtdemux-&gt;cenc_aux_sample_count = 0;
+   qtdemux-&gt;protection_system_ids = NULL;
++  qtdemux-&gt;always_honor_tfdt = FALSE;
+   g_queue_init (&amp;qtdemux-&gt;protection_event_queue);
+   gst_segment_init (&amp;qtdemux-&gt;segment, GST_FORMAT_TIME);
+   qtdemux-&gt;flowcombiner = gst_flow_combiner_new ();
+@@ -639,6 +658,42 @@ gst_qtdemux_dispose (GObject * object)
+ }

+ static void
++gst_qtdemux_set_property (GObject * object, guint prop_id,
++    const GValue * value, GParamSpec * pspec)
++{
++  GstQTDemux *qtdemux = GST_QTDEMUX (object);
++
++  switch (prop_id) {
++    case PROP_ALWAYS_HONOR_TFDT:
++      GST_OBJECT_LOCK (qtdemux);
++      qtdemux-&gt;always_honor_tfdt = g_value_get_boolean (value);
++      GST_OBJECT_UNLOCK (qtdemux);
++      break;
++    default:
++      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++      break;
++  }
++}
++
++static void
++gst_qtdemux_get_property (GObject * object, guint prop_id, GValue * value,
++    GParamSpec * pspec)
++{
++  GstQTDemux *qtdemux = GST_QTDEMUX (object);
++
++  switch (prop_id) {
++    case PROP_ALWAYS_HONOR_TFDT:
++      GST_OBJECT_LOCK (qtdemux);
++      g_value_set_boolean (value, qtdemux-&gt;always_honor_tfdt);
++      GST_OBJECT_UNLOCK (qtdemux);
++      break;
++    default:
++      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++      break;
++  }
++}
++
++static void
+ gst_qtdemux_post_no_playable_stream_error (GstQTDemux * qtdemux)
+ {
+   if (qtdemux-&gt;posted_redirect) {
+@@ -2995,6 +3050,16 @@ qtdemux_parse_trun (GstQTDemux * qtdemux, GstByteReader * trun,
+           stream-&gt;samples[stream-&gt;n_samples - 1].timestamp +
+           stream-&gt;samples[stream-&gt;n_samples - 1].duration;

++      /* If we're always honoring TFDT and there's a significative difference
++       * between the decode_ts and the timestamp, prefer decode_ts */
++      if (qtdemux-&gt;always_honor_tfdt == TRUE
++          &amp;&amp; abs (decode_ts - timestamp) &gt;
++          stream-&gt;samples[stream-&gt;n_samples - 1].duration) {
++        GST_INFO_OBJECT (qtdemux,
++            &quot;decode_ts is significantly different from timestamp, using decode_ts&quot;);
++        timestamp = decode_ts;
++      }
++
+       gst_ts = QTSTREAMTIME_TO_GSTTIME (stream, timestamp);
+       GST_INFO_OBJECT (qtdemux, &quot;first sample ts %&quot; GST_TIME_FORMAT
+           &quot; (extends previous samples)&quot;, GST_TIME_ARGS (gst_ts));
+diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h
+index 53bd071..ecf0c63 100644
+--- a/gst/isomp4/qtdemux.h
++++ b/gst/isomp4/qtdemux.h
+@@ -154,12 +154,20 @@ struct _GstQTDemux {
+   guint8 *cenc_aux_info_sizes;
+   guint32 cenc_aux_sample_count;

++  gboolean always_honor_tfdt;
+ };

+ struct _GstQTDemuxClass {
+   GstElementClass parent_class;
+ };

++/* props */
++enum
++{
++  PROP_0,
++  PROP_ALWAYS_HONOR_TFDT
++};
++
+ GType gst_qtdemux_get_type (void);

+ G_END_DECLS
+-- 
+2.6.1
+
</ins></span></pre>
</div>
</div>

</body>
</html>