After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750804 - dashdemux: incorrectly calculates presentationTimeOffset if the value is larger than 2^32
dashdemux: incorrectly calculates presentationTimeOffset if the value is larg...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-11 16:29 UTC by A Ashley
Modified: 2015-06-11 17:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dashdemux: fix error calculating large presentation time offset (3.24 KB, patch)
2015-06-11 16:33 UTC, A Ashley
committed Details | Review

Description A Ashley 2015-06-11 16:29:08 UTC
If the presentationTimeOffset attribute of a DASH manifest contains a value that is larger than 2^32, gstmpdparser incorrectly calculates the stream's presentation time offset.

For example, the following manifest produces an incorrect value for stream->presentationTimeOffset:

<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" type="dynamic" minimumUpdatePeriod="P42Y" minBufferTime="PT5.000S" maxSegmentDuration="PT4.080S" availabilityStartTime="2015-06-11T16:11:00Z" timeShiftBufferDepth="PT24.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
  <Period id="0" start="PT0S">
    <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" maxWidth="704" maxHeight="396" maxFrameRate="25" par="16:9">
      <SegmentTemplate timescale="90000" initialization="$RepresentationID$/Header.m4s" media="$RepresentationID$/$Number$.m4s" duration="360000" startNumber="918471" presentationTimeOffset="325434516507"/>
      <Representation id="video1" width="704" height="396" frameRate="25" sar="1:1" scanType="progressive" bandwidth="1200000" codecs="avc1.4D401E"/>
 </AdaptationSet>
 </Period>
</MPD>


The correct GstClockTime should be 1004:25:39.0723
Comment 1 A Ashley 2015-06-11 16:33:00 UTC
Created attachment 305087 [details] [review]
dashdemux: fix error calculating large presentation time offset

If the presentationTimeOffset attribute of a DASH manifest contains a value that is larger than 2^32, gstmpdparser incorrectly calculates the stream's presentation time offset. This is due to two bugs:
    
1: Using gst_mpdparser_get_xml_prop_unsigned_integer rather than
   gst_mpdparser_get_xml_prop_unsigned_integer_64 to parse the
   attribute

2: gst_mpd_client_setup_representation multiplies the value by
   GST_SECOND and then divides by timescale, causing 64 bit overflow
Comment 2 Sebastian Dröge (slomo) 2015-06-11 17:41:32 UTC
commit 5beeccdba283970f0c61b31927d75f046a962e0e
Author: Alex Ashley <bugzilla@ashley-family.net>
Date:   Thu Jun 11 17:25:49 2015 +0100

    dashdemux: fix error calculating large presentationTimeOffset values
    
    If the presentationTimeOffset attribute of a DASH manifest contains
    a value that is larger than 2^32, gstmpdparser incorrectly calculates
    the stream's presentation time offset. This is due to two bugs:
    
    1: Using gst_mpdparser_get_xml_prop_unsigned_integer rather than
       gst_mpdparser_get_xml_prop_unsigned_integer_64 to parse the
       attribute
    2: gst_mpd_client_setup_representation multiplying the value by
       GST_SECOND and then dividing by timescale
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750804